F:/KPlato/koffice/libs/flake/KoToolFactory.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002  * Copyright (c) 2004 Boudewijn Rempt <boud@valdyas.org>
00003  * Copyright (C) 2006 Thomas Zander <zander@kde.org>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef KO_TOOL_FACTORY_H
00022 #define KO_TOOL_FACTORY_H
00023 
00024 #include "KoTool.h"
00025 #include <KoID.h>
00026 #include <koffice_export.h>
00027 
00028 #include <klocale.h>
00029 #include <QObject>
00030 #include <QKeySequence>
00031 
00055 class FLAKE_EXPORT KoToolFactory : public QObject {
00056     Q_OBJECT
00057 
00058 public:
00066     KoToolFactory(QObject *parent, const QString &id, const QString &name);
00067     virtual ~KoToolFactory();
00068 
00075     virtual KoTool * createTool(KoCanvasBase *canvas) = 0;
00080     const QString &toolId() const;
00085     const QString &name() const;
00089     const KoID id() const;
00094     int priority() const;
00099     const QString &toolType() const;
00104     const QString &toolTip() const;
00109     const QString& icon() const;
00115     const QString &activationShapeId() const;
00116 
00123     QKeySequence shortcut() const;
00124 
00134     static QString mainToolType() { return "main"; }
00146     static QString dynamicToolType() { return "dynamic"; }
00147 
00148 protected:
00153     void setToolTip(const QString & tooltip);
00158     void setToolType(const QString & toolType);
00164     void setIcon(const QString & iconName);
00170     void setPriority(int newPriority);
00178     void setActivationShapeID(const QString &activationShapeId);
00179 
00183     void setShortcut(const QKeySequence & shortcut);
00184 
00185 private:
00186     QString m_toolType;
00187     QString m_tooltip;
00188     QString m_activationId;
00189     QString m_icon;
00190     const QString m_name, m_id;
00191     int m_priority;
00192     QKeySequence m_shortcut;
00193 };
00194 
00195 #endif

Généré le Wed Nov 22 23:41:00 2006 pour KPlato par  doxygen 1.5.1-p1