• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

libkdepim

  • sources
  • kde-4.14
  • kdepim
  • libkdepim
  • addressline
  • completionorder
completionorderwidget.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2015 Montel Laurent <montel@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 
19 */
20 
21 #ifndef COMPLETIONORDERWIDGET_H
22 #define COMPLETIONORDERWIDGET_H
23 
24 #include <QWidget>
25 #include "kdepim_export.h"
26 #include <QDBusAbstractAdaptor>
27 #include <KConfig>
28 
29 class KPushButton;
30 class QAbstractItemModel;
31 class QModelIndex;
32 class QTreeWidget;
33 
34 namespace KLDAP {
35 class LdapClientSearch;
36 }
37 
38 namespace KPIM {
39 
40 class CompletionOrderEditorAdaptor : public QDBusAbstractAdaptor
41 {
42  Q_OBJECT
43  Q_CLASSINFO("D-Bus Interface", "org.kde.pim.CompletionOrder" )
44 public:
45  explicit CompletionOrderEditorAdaptor( QObject *parent );
46 Q_SIGNALS:
47  void completionOrderChanged();
48 };
49 
50 
51 class CompletionOrderWidget;
52 
53 // Base class for items in the list
54 class CompletionItem
55 {
56 public:
57  virtual ~CompletionItem() {}
58  virtual QString label() const = 0;
59  virtual QIcon icon() const = 0;
60  virtual int completionWeight() const = 0;
61  virtual void setCompletionWeight( int weight ) = 0;
62  virtual void save( CompletionOrderWidget* ) = 0;
63 };
64 
65 
66 class KDEPIM_EXPORT CompletionOrderWidget : public QWidget
67 {
68  Q_OBJECT
69 public:
70  explicit CompletionOrderWidget(QWidget *parent = 0);
71  ~CompletionOrderWidget();
72  void save();
73 
74  KConfig* configFile() { return &mConfig; }
75  void loadCompletionItems();
76  void setLdapClientSearch(KLDAP::LdapClientSearch *ldapSearch);
77 
78 Q_SIGNALS:
79  void completionOrderChanged();
80 
81 private Q_SLOTS:
82  void rowsInserted( const QModelIndex &parent, int start, int end );
83  void slotSelectionChanged();
84  void slotMoveUp();
85  void slotMoveDown();
86 
87 private:
88  void readConfig();
89  void writeConfig();
90  void addRecentAddressItem();
91  void addCompletionItemForCollection( const QModelIndex& );
92 
93  KConfig mConfig;
94  QTreeWidget* mListView;
95  KPushButton* mUpButton;
96  KPushButton* mDownButton;
97  QAbstractItemModel *mCollectionModel;
98  KLDAP::LdapClientSearch *mLdapSearch;
99 
100  bool mDirty;
101 
102 };
103 }
104 
105 #endif // COMPLETIONORDERWIDGET_H
KPIM::CompletionItem::~CompletionItem
virtual ~CompletionItem()
Definition: completionorderwidget.h:57
kdepim_export.h
QModelIndex
QWidget
KPIM::CompletionOrderEditorAdaptor
Definition: completionorderwidget.h:40
KLDAP::LdapClientSearch
Definition: ldapclientsearch.h:68
KPIM::CompletionItem::setCompletionWeight
virtual void setCompletionWeight(int weight)=0
QDBusAbstractAdaptor
QTreeWidget
KPIM::CompletionOrderWidget
Definition: completionorderwidget.h:66
QObject
QString
KPIM::CompletionItem::completionWeight
virtual int completionWeight() const =0
KPIM::CompletionItem::icon
virtual QIcon icon() const =0
KPIM::CompletionItem::label
virtual QString label() const =0
KPIM::CompletionItem
Definition: completionorderwidget.h:54
QAbstractItemModel
KPIM::CompletionItem::save
virtual void save(CompletionOrderWidget *)=0
KPIM::CompletionOrderEditorAdaptor::completionOrderChanged
void completionOrderChanged()
QObject::parent
QObject * parent() const
KDEPIM_EXPORT
#define KDEPIM_EXPORT
Definition: kdepim_export.h:35
QIcon
KPIM::CompletionOrderEditorAdaptor::CompletionOrderEditorAdaptor
CompletionOrderEditorAdaptor(QObject *parent)
Definition: completionorderwidget.cpp:50
KPIM::CompletionOrderWidget::configFile
KConfig * configFile()
Definition: completionorderwidget.h:74
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal