digiKam
token.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2009-08-08
7  * Description : a token class
8  *
9  * Copyright (C) 2009-2012 by Andi Clemens <andi dot clemens at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_TOKEN_H
25 #define DIGIKAM_TOKEN_H
26 
27 // Qt includes
28 
29 #include <QList>
30 #include <QObject>
31 #include <QString>
32 
33 class QAction;
34 
35 namespace Digikam
36 {
37 
63 class Token : public QObject
64 {
65  Q_OBJECT
66 
67 public:
68 
69  explicit Token(const QString& id, const QString& description);
70  ~Token() override;
71 
79  QString id()
80  {
81  return m_id;
82  };
83 
87  QString description()
88  {
89  return m_description;
90  };
91 
96  QAction* action()
97  {
98  return m_action;
99  };
100 
101 Q_SIGNALS:
102 
106  void signalTokenTriggered(const QString&);
107 
108 private Q_SLOTS:
109 
113  void slotTriggered();
114 
115 private:
116 
117  // Disable
118  Token(QObject*) = delete;
119  Token(const Token&) = delete;
120  Token& operator=(const Token&) = delete;
121 
122 private:
123 
124  QString m_id;
125  QString m_description;
126  QAction* m_action;
127 };
128 
130 
131 } // namespace Digikam
132 
133 #endif // DIGIKAM_TOKEN_H
Token is the smallest parsing unit in AdvancedRename utility
Definition: token.h:64
QString id()
Definition: token.h:79
Token(const QString &id, const QString &description)
Definition: token.cpp:33
~Token() override
Definition: token.cpp:45
QAction * action()
Definition: token.h:96
QString description()
Definition: token.h:87
void signalTokenTriggered(const QString &)
Definition: datefolderview.cpp:43
QList< Token * > TokenList
Definition: token.h:129