Plasma
plasma.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2005 by Aaron Seigo <aseigo@kde.org> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef PLASMA_DEFS_H 00021 #define PLASMA_DEFS_H 00022 00025 #include <QtGui/QGraphicsItem> 00026 #include <QtGui/QPainterPath> 00027 00028 #include <plasma/plasma_export.h> 00029 00030 class QAction; 00031 class QGraphicsView; 00032 00036 namespace Plasma 00037 { 00038 00044 enum Constraint { 00045 NoConstraint = 0, 00047 FormFactorConstraint = 1, 00049 LocationConstraint = 2, 00051 ScreenConstraint = 4, 00053 SizeConstraint = 8, 00055 ImmutableConstraint = 16, 00057 StartupCompletedConstraint = 32, 00059 ContextConstraint = 64, 00061 PopupConstraint = 128, 00062 AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint | 00063 SizeConstraint | ImmutableConstraint | ContextConstraint | PopupConstraint 00064 }; 00065 Q_DECLARE_FLAGS(Constraints, Constraint) 00066 00067 00072 enum FormFactor { 00073 Planar = 0, 00078 MediaCenter, 00083 Horizontal, 00085 Vertical 00087 }; 00088 00095 enum Direction { 00096 Down = 0, 00097 Up, 00098 Left, 00099 Right 00100 }; 00101 00105 enum ZoomDirection { 00106 ZoomIn = 0, 00107 ZoomOut = 1 00108 }; 00109 00114 enum Location { 00115 Floating = 0, 00117 Desktop, 00119 FullScreen, 00120 TopEdge, 00121 BottomEdge, 00122 LeftEdge, 00123 RightEdge 00124 }; 00125 00130 enum Position { 00131 LeftPositioned, 00132 RightPositioned, 00133 TopPositioned, 00134 BottomPositioned, 00135 CenterPositioned 00136 }; 00137 00143 enum PopupPlacement { 00144 FloatingPopup = 0, 00145 TopPosedLeftAlignedPopup, 00147 TopPosedRightAlignedPopup, 00149 LeftPosedTopAlignedPopup, 00151 LeftPosedBottomAlignedPopup, 00153 BottomPosedLeftAlignedPopup, 00155 BottomPosedRightAlignedPopup, 00157 RightPosedTopAlignedPopup, 00159 RightPosedBottomAlignedPopup 00161 }; 00162 00166 enum FlipDirection { 00167 NoFlip = 0, 00168 HorizontalFlip = 1, 00169 VerticalFlip = 2 00170 }; 00171 Q_DECLARE_FLAGS(Flip, FlipDirection) 00172 00173 00176 enum ZoomLevel { 00177 DesktopZoom = 0, 00179 GroupZoom, 00181 OverviewZoom 00182 }; 00183 00187 enum IntervalAlignment { 00188 NoAlignment = 0, 00189 AlignToMinute, 00190 AlignToHour 00191 }; 00192 00193 enum ItemTypes { 00194 AppletType = QGraphicsItem::UserType + 1, 00195 LineEditType = QGraphicsItem::UserType + 2 00196 }; 00197 00203 enum ImmutabilityType { 00204 Mutable = 1, 00205 UserImmutable = 2, 00207 SystemImmutable = 4 00209 }; 00210 00214 enum AspectRatioMode { 00215 InvalidAspectRatioMode = -1, 00218 IgnoreAspectRatio = 0, 00219 KeepAspectRatio = 1, 00220 Square = 2, 00221 ConstrainedSquare = 3, 00224 FixedSize = 4 00225 }; 00226 00231 enum ComponentType { 00232 AppletComponent = 1, 00233 DataEngineComponent = 2, 00234 RunnerComponent = 4, 00235 AnimatorComponent = 8, 00236 ContainmentComponent = 16, 00237 WallpaperComponent = 32 00238 }; 00239 Q_DECLARE_FLAGS(ComponentTypes, ComponentType) 00240 00241 enum MarginEdge { 00242 TopMargin = 0, 00243 BottomMargin, 00244 LeftMargin, 00245 RightMargin 00246 }; 00247 00248 enum MessageButton { 00249 ButtonNone = 0, 00250 ButtonOk = 1, 00251 ButtonYes = 2, 00252 ButtonNo = 4, 00253 ButtonCancel = 8 00254 }; 00255 Q_DECLARE_FLAGS(MessageButtons, MessageButton) 00256 00257 00261 enum ItemStatus { 00262 UnknownStatus = 0, 00263 PassiveStatus = 1, 00264 ActiveStatus = 2, 00265 NeedsAttentionStatus = 3, 00266 AcceptingInputStatus = 4 00267 }; 00268 Q_ENUMS(ItemStatus) 00269 00270 enum AnnouncementMethod { 00271 NoAnnouncement = 0, 00272 ZeroconfAnnouncement = 1 00273 }; 00274 Q_DECLARE_FLAGS(AnnouncementMethods, AnnouncementMethod) 00275 00276 enum TrustLevel { 00277 InvalidCredentials = 0, 00278 UnknownCredentials = 1, 00279 ValidCredentials = 2, 00280 TrustedCredentials = 3, 00281 UltimateCredentials = 4 00282 }; 00283 Q_ENUMS(TrustLevel) 00284 00285 00288 PLASMA_EXPORT qreal scalingFactor(ZoomLevel level); 00289 00297 PLASMA_EXPORT Direction locationToDirection(Location location); 00298 00306 PLASMA_EXPORT Direction locationToInverseDirection(Location location); 00307 00314 PLASMA_EXPORT QGraphicsView *viewFor(const QGraphicsItem *item); 00315 00327 PLASMA_EXPORT QList<QAction*> actionsFromMenu(QMenu *menu, 00328 const QString &prefix = QString(), 00329 QObject *parent = 0); 00330 00331 } // Plasma namespace 00332 00333 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Constraints) 00334 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip) 00335 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::ComponentTypes) 00336 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::MessageButtons) 00337 00338 00339 #endif // multiple inclusion guard
KDE 4.6 API Reference