umbrello API Documentation

worktoolbar.h

00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *   copyright (C) 2002-2007                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 #ifndef WORKTOOLBAR_H
00013 #define WORKTOOLBAR_H
00014 
00015 #include <qmap.h>
00016 #include <qpixmap.h>
00017 #include <qcursor.h>
00018 #include <ktoolbar.h>
00019 
00020 #include "umlnamespace.h"
00021 
00022 class QMainWindow;
00023 
00024 
00042 class WorkToolBar : public KToolBar {
00043     Q_OBJECT
00044 public:
00045 
00051     WorkToolBar(QMainWindow *parentWindow, const char *name);
00052 
00056     ~WorkToolBar();
00057 
00062     void setOldTool();
00063 
00069     void setDefaultTool();
00070 
00074     enum ToolBar_Buttons
00075     {
00076         tbb_Undefined = -1,
00077         tbb_Arrow,
00078         tbb_Generalization,
00079         tbb_Aggregation,
00080         tbb_Dependency,
00081         tbb_Association,
00082         tbb_Containment,
00083         tbb_Coll_Message,
00084         tbb_Seq_Message_Synchronous,
00085         tbb_Seq_Message_Asynchronous,
00086         tbb_Composition,
00087         tbb_Relationship,
00088         tbb_UniAssociation,
00089         tbb_State_Transition,
00090         tbb_Activity_Transition,
00091         tbb_Anchor,//keep anchor as last association until code uses better algorithm for testing
00092         tbb_Note,
00093         tbb_Box,
00094         tbb_Text,
00095         tbb_Actor,
00096         tbb_UseCase,
00097         tbb_Class,
00098         tbb_Interface,
00099         tbb_Datatype,
00100         tbb_Enum,
00101         tbb_Entity,
00102         tbb_Package,
00103         tbb_Component,
00104         tbb_Node,
00105         tbb_Artifact,
00106         tbb_Object,
00107         tbb_Initial_State,
00108         tbb_State,
00109         tbb_End_State,
00110         tbb_Initial_Activity,
00111         tbb_Activity,
00112         tbb_End_Activity,
00113         tbb_Branch,
00114         tbb_Fork,
00115         tbb_DeepHistory,
00116         tbb_ShallowHistory,
00117         tbb_Join,
00118         tbb_StateFork,
00119         tbb_Junction,
00120         tbb_Choice,
00121         tbb_Andline
00122     };
00123 
00124 private:
00125 
00126     typedef QMap<Uml::Diagram_Type,ToolBar_Buttons> OldToolMap;
00127 
00131     class ToolButton {
00132     public:
00133         QString Label;
00134         QPixmap Symbol;
00135         QCursor Cursor;
00136         ToolButton() : Label(QString("?")), Symbol(QPixmap()), Cursor(QCursor()) { }
00137         ToolButton(const QString& lbl, const QPixmap& smb, const QCursor& cur) :
00138         Label(lbl), Symbol(smb), Cursor(cur) { }
00139     };
00140 
00141     typedef QMap<ToolBar_Buttons, ToolButton> ToolButtonMap;
00142 
00143     ToolBar_Buttons     m_CurrentButtonID;
00144     OldToolMap          m_map;
00145     Uml::Diagram_Type   m_Type;
00146     ToolButtonMap       m_ToolButtons;
00147 
00151     QPixmap load(const QString &fileName);
00152 
00156     void loadPixmaps();
00157 
00161     QCursor currentCursor();
00162 
00167     void insertHotBtn(ToolBar_Buttons tbb);
00168 
00173     void insertBasicAssociations();
00174 
00175 signals:
00176     void sigButtonChanged(int);
00177 public slots:
00178     void slotCheckToolBar(Uml::Diagram_Type dt);
00179     void buttonChanged(int b);
00180     void slotResetToolBar();
00181 };
00182 
00183 #endif
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:03 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003