1 /*
2     SPDX-FileCopyrightText: 2008 Andreas Fischer <andi.fischer@hispeed.ch>
3 
4     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
5 */
6 #ifndef ICON_UTILS_H
7 #define ICON_UTILS_H
8 
9 // app includes
10 #include "basictypes.h"
11 
12 // kde includes
13 #if QT_VERSION < 0x050000
14 #include <kicon.h>
15 #endif
16 
17 // qt includes
18 #include <QCursor>
19 #if QT_VERSION >= 0x050000
20 #include <QIcon>
21 #endif
22 #include <QPixmap>
23 
24 /**
25  * This class is a gateway to KIconLoader for for handling all the
26  * icons used in umbrello. Identification is done with an enum and
27  * then a translation to the icon name.
28  * @author  Andreas Fischer
29  */
30 namespace Icon_Utils {
31 
32     enum IconType
33     {
34         it_Home = 0,
35         it_Arrow,
36         it_File_Open,
37         it_Folder,
38         it_Folder_Cyan,
39         it_Folder_Cyan_Open,
40         it_Folder_Green,
41         it_Folder_Green_Open,
42         it_Folder_Grey,
43         it_Folder_Grey_Open,
44         it_Folder_Red,
45         it_Folder_Red_Open,
46         it_Folder_Violet,
47         it_Folder_Violet_Open,
48         it_Folder_Orange,
49         it_Folder_Orange_Open,
50         it_Properties_General,
51         it_Properties_Color,
52         it_Properties_Display,
53         it_Properties_Attributes,
54         it_Properties_Operations,
55         it_Properties_Templates,
56         it_Properties_EnumLiterals,
57         it_Properties_EntityAttributes,
58         it_Properties_EntityConstraints,
59         it_Properties_Contents,
60         it_Properties_Associations,
61         it_Properties_Font,
62         it_Properties_Activities,
63         it_Properties_Roles,
64         it_Properties_UserInterface,
65         it_Properties_Class,
66         it_Properties_CodeImport,
67         it_Properties_CodeGeneration,
68         it_Properties_CodeViewer,
69         it_Properties_Columns,
70         it_Diagram, //change to have different one for each type of diagram
71         it_Class,
72         it_Object,
73         it_Template,
74         it_Template_Class,
75         it_Template_Interface,
76         it_Package,
77         it_Subsystem,
78         it_Component,
79         it_Port,
80         it_Node,
81         it_Artifact,
82         it_Interface,
83         it_Interface_Provider,
84         it_Interface_Requirement,
85         it_Datatype,
86         it_Enum,
87         it_Entity,
88         it_Actor,
89         it_UseCase,
90         it_Generalisation,
91         it_Association,
92         it_Uniassociation,
93         it_Text,
94         it_Note,
95         it_Box,
96         it_Anchor,
97         it_Containment,
98         it_Public_Method,
99         it_Private_Method,
100         it_Protected_Method,
101         it_Implementation_Method,
102         it_Public_Attribute,
103         it_Private_Attribute,
104         it_Protected_Attribute,
105         it_Implementation_Attribute,
106         it_Unique_Constraint,
107         it_PrimaryKey_Constraint,
108         it_ForeignKey_Constraint,
109         it_Check_Constraint,
110         it_Diagram_Activity,
111         it_Diagram_Class,
112         it_Diagram_Collaboration,
113         it_Diagram_Component,
114         it_Diagram_Deployment,
115         it_Diagram_EntityRelationship,
116         it_Diagram_Sequence,
117         it_Diagram_State,
118         it_Diagram_Usecase,
119         it_Diagram_Object,
120         it_New,
121         it_Delete,
122         it_Add_Point,
123         it_Delete_Point,
124         it_Rename,
125         it_Cut,
126         it_Copy,
127         it_Paste,
128         it_Undo,
129         it_Redo,
130         it_UndoView,
131         it_Go_Next,
132         it_Go_Previous,
133         it_Properties,
134         it_Show,
135         it_Refactor,
136         it_View_Code,
137         it_Tab_New,
138         it_Tab_Close,
139         it_Change_Font,
140         it_Arrow_Up,
141         it_Arrow_Down,
142         it_Clear,
143         it_Operation_New,
144         it_Operation_Public_New,
145         it_Attribute_New,
146         it_Template_New,
147         it_Literal_New,
148         it_Entity_Attribute_New,
149         it_Parameter_New,
150         it_Color_Line,
151         it_Color_Fill,
152         it_Import_File,
153         it_Import_Project,
154         it_Import_Files,
155         it_Export_Files,
156         it_Export_Picture,
157         it_InitialState,
158         it_EndState,
159         it_Branch,
160         it_Entity_Attribute,
161         it_Constraint_PrimaryKey,
162         it_Constraint_ForeignKey,
163         it_Constraint_Check,
164         it_Constraint_Unique,
165         it_Enum_Literal,
166         it_State_Activity,
167         it_Message_Creation,
168         it_Message_Destroy,
169         it_Message_Sync,
170         it_Message_Async,
171         it_Message_Found,
172         it_Message_Lost,
173         it_Combined_Fragment,
174         it_Precondition,
175         it_Dependency,
176         it_Aggregation,
177         it_Relationship,
178         it_Directional_Association,
179         it_Implements,
180         it_Composition,
181         it_Region,
182         it_Send_Signal,
183         it_Accept_Signal,
184         it_Accept_TimeEvent,
185         it_Fork_Join,
186         it_History_Deep,
187         it_History_Shallow,
188         it_Join,
189         it_Fork_State,
190         it_Junction,
191         it_Choice_Round,
192         it_Choice_Rhomb,
193         it_And_Line,
194         it_State_Transition,
195         it_Activity_Transition,
196         it_Activity,
197         it_State,
198         it_Activity_End,
199         it_Activity_Final,
200         it_Pin,
201         it_Activity_Initial,
202         it_Message_Synchronous,
203         it_Message_Asynchronous,
204         it_Exception,
205         it_Object_Node,
206         it_Condition_PrePost,
207         it_Category,
208         it_Category_Parent,
209         it_Category_Child,
210         it_Zoom_Slider,
211         it_Zoom_100,
212         it_Align_Right,
213         it_Align_Left,
214         it_Align_Top,
215         it_Align_Bottom,
216         it_Align_VerticalMiddle,
217         it_Align_HorizontalMiddle,
218         it_Align_VerticalDistribute,
219         it_Align_HorizontalDistribute,
220         it_Code_Gen_Wizard,
221         it_Properties_AutoLayout,
222         it_Document_Edit,
223         it_ClassOrPackage,
224         it_Instance,
225         it_Remove,
226         it_Duplicate,
227         N_ICONTYPES    // must remain last
228     };
229 
230     QPixmap SmallIcon(IconType type);
231     QPixmap BarIcon(IconType type);
232     QPixmap MainBarIcon(IconType type);
233     QPixmap UserIcon(IconType type);
234 
235     QPixmap DesktopIcon(IconType type);
236 
237     QCursor Cursor(IconType type);
238 
239     QString toString(IconType type);
240 
241     QPixmap iconSet(Uml::DiagramType::Enum dt);
242     QPixmap smallIcon(Uml::DiagramType::Enum dt);
243 
244 }  // namespace
245 
246 #endif  // ICONCONTAINER_H
247