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

mailcommon

  • sources
  • kde-4.12
  • kdepim
  • mailcommon
  • tag
tag.h
Go to the documentation of this file.
1 /* Copyright 2010 Thomas McGuire <mcguire@kde.org>
2 
3  This program is free software; you can redistribute it and/or
4  modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation; either version 2 of
6  the License or (at your option) version 3 or any later version
7  accepted by the membership of KDE e.V. (or its successor approved
8  by the membership of KDE e.V.), which shall act as a proxy
9  defined in Section 14 of version 3 of the license.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #ifndef MAILCOMMONTAG_H
20 #define MAILCOMMONTAG_H
21 
22 #include "mailcommon_export.h"
23 
24 #include <KShortcut>
25 
26 #include <QColor>
27 #include <QFont>
28 #include <QSharedPointer>
29 #include <QUrl>
30 
31 namespace Nepomuk2 {
32  class Tag;
33 }
34 
35 namespace MailCommon {
36 
37  // Our own copy of the tag data normally attached to a Nepomuk2::Tag.
38  // Useful in the config dialog, because the user might cancel his changes,
39  // in which case we don't write them back to the Nepomuk2::Tag.
40  // Also used as a convenience class in the TagActionManager.
41  class MAILCOMMON_EXPORT Tag
42  {
43  Q_GADGET
44  public:
45 
46  typedef QSharedPointer<Tag> Ptr;
47  enum SaveFlag {
48  TextColor = 1,
49  BackgroundColor = 1 << 1,
50  Font = 1 << 2
51  };
52  typedef QFlags<SaveFlag> SaveFlags;
53 
54  // Returns true if two tags are equal
55  bool operator==( const Tag &other ) const;
56 
57  bool operator!=( const Tag &other ) const;
58 
59  // Load a tag from a Nepomuk tag
60  static Ptr fromNepomuk( const Nepomuk2::Tag& nepomukTag );
61 
62  // Save this tag to Nepomuk the corresponding Nepomuk tag
63  void saveToNepomuk( SaveFlags saveFlags ) const;
64 
65  // Compare, based on priority
66  static bool compare( Ptr &tag1, Ptr &tag2 );
67  // Compare, based on name
68  static bool compareName( Ptr &tag1, Ptr &tag2 );
69 
70  QString tagName;
71  QColor textColor;
72  QColor backgroundColor;
73  QFont textFont;
74  QString iconName;
75  QUrl nepomukResourceUri;
76  KShortcut shortcut;
77  bool inToolbar;
78  bool tagStatus;
79 
80  // Priority, i.e. sort order of the tag. Only used when loading the tag, when saving
81  // the priority is set to the position in the list widget
82  int priority;
83  };
84  Q_DECLARE_OPERATORS_FOR_FLAGS(Tag::SaveFlags)
85 
86 }
87 
88 #endif
QSharedPointer
Definition: collectiongeneralpage.h:30
MailCommon::Tag::SaveFlag
SaveFlag
Definition: tag.h:47
MailCommon::Tag::tagStatus
bool tagStatus
Definition: tag.h:78
MailCommon::Tag::SaveFlags
QFlags< SaveFlag > SaveFlags
Definition: tag.h:52
mailcommon_export.h
MailCommon::Tag
Definition: tag.h:41
MailCommon::Tag::nepomukResourceUri
QUrl nepomukResourceUri
Definition: tag.h:75
MailCommon::Tag::shortcut
KShortcut shortcut
Definition: tag.h:76
MailCommon::Tag::priority
int priority
Definition: tag.h:82
MAILCOMMON_EXPORT
#define MAILCOMMON_EXPORT
Definition: mailcommon_export.h:35
MailCommon::Tag::iconName
QString iconName
Definition: tag.h:74
MailCommon::Tag::tagName
QString tagName
Definition: tag.h:70
MailCommon::Tag::backgroundColor
QColor backgroundColor
Definition: tag.h:72
MailCommon::Tag::textColor
QColor textColor
Definition: tag.h:71
MailCommon::Tag::Ptr
QSharedPointer< Tag > Ptr
Definition: tag.h:46
MailCommon::Tag::inToolbar
bool inToolbar
Definition: tag.h:77
MailCommon::Tag::textFont
QFont textFont
Definition: tag.h:73
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailcommon

Skip menu "mailcommon"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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

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