00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 QGraphicsView;
00031
00035 namespace Plasma
00036 {
00037
00043 enum Constraint {
00044 NoConstraint = 0,
00046 FormFactorConstraint = 1,
00048 LocationConstraint = 2,
00050 ScreenConstraint = 4,
00052 SizeConstraint = 8,
00054 ImmutableConstraint = 16,
00056 StartupCompletedConstraint = 32,
00058 ContextConstraint = 64,
00059 AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint |
00060 SizeConstraint | ImmutableConstraint | ContextConstraint
00061 };
00062 Q_DECLARE_FLAGS(Constraints, Constraint)
00063
00064
00069 enum FormFactor {
00070 Planar = 0,
00075 MediaCenter,
00080 Horizontal,
00082 Vertical
00084 };
00085
00092 enum Direction {
00093 Down = 0,
00094 Up,
00095 Left,
00096 Right
00097 };
00098
00102 enum ZoomDirection {
00103 ZoomIn = 0,
00104 ZoomOut = 1
00105 };
00106
00111 enum Location {
00112 Floating = 0,
00114 Desktop,
00116 FullScreen,
00117 TopEdge,
00118 BottomEdge,
00119 LeftEdge,
00120 RightEdge
00121 };
00122
00127 enum Position {
00128 LeftPositioned,
00129 RightPositioned,
00130 TopPositioned,
00131 BottomPositioned,
00132 CenterPositioned
00133 };
00134
00140 enum PopupPlacement {
00141 FloatingPopup = 0,
00142 TopPosedLeftAlignedPopup,
00144 TopPosedRightAlignedPopup,
00146 LeftPosedTopAlignedPopup,
00148 LeftPosedBottomAlignedPopup,
00150 BottomPosedLeftAlignedPopup,
00152 BottomPosedRightAlignedPopup,
00154 RightPosedTopAlignedPopup,
00156 RightPosedBottomAlignedPopup
00158 };
00159
00163 enum FlipDirection {
00164 NoFlip = 0,
00165 HorizontalFlip = 1,
00166 VerticalFlip = 2
00167 };
00168 Q_DECLARE_FLAGS(Flip, FlipDirection)
00169
00170
00173 enum ZoomLevel {
00174 DesktopZoom = 0,
00176 GroupZoom,
00178 OverviewZoom
00179 };
00180
00184 enum IntervalAlignment {
00185 NoAlignment = 0,
00186 AlignToMinute,
00187 AlignToHour
00188 };
00189
00190 enum ItemTypes {
00191 AppletType = QGraphicsItem::UserType + 1,
00192 LineEditType = QGraphicsItem::UserType + 2
00193 };
00194
00200 enum ImmutabilityType {
00201 Mutable = 1,
00202 UserImmutable = 2,
00204 SystemImmutable = 4
00206 };
00207
00211 enum AspectRatioMode {
00212 InvalidAspectRatioMode = -1,
00215 IgnoreAspectRatio = 0,
00216 KeepAspectRatio = 1,
00217 Square = 2,
00218 ConstrainedSquare = 3,
00221 FixedSize = 4
00222 };
00223
00228 enum ComponentType {
00229 AppletComponent = 1,
00230 DataEngineComponent = 2,
00231 RunnerComponent = 4,
00232 AnimatorComponent = 8,
00233 ContainmentComponent = 16
00234 };
00235 Q_DECLARE_FLAGS(ComponentTypes, ComponentType)
00236
00237 enum MarginEdge {
00238 TopMargin = 0,
00239 BottomMargin,
00240 LeftMargin,
00241 RightMargin
00242 };
00243
00244 enum MessageButton {
00245 ButtonNone = 0,
00246 ButtonOk = 1,
00247 ButtonYes = 2,
00248 ButtonNo = 4,
00249 ButtonCancel = 8
00250 };
00251 Q_DECLARE_FLAGS(MessageButtons, MessageButton)
00252
00253
00254
00257 PLASMA_EXPORT qreal scalingFactor(ZoomLevel level);
00258
00266 PLASMA_EXPORT Direction locationToDirection(Location location);
00267
00275 PLASMA_EXPORT Direction locationToInverseDirection(Location location);
00276
00283 PLASMA_EXPORT QGraphicsView *viewFor(const QGraphicsItem *item);
00284
00285 }
00286
00287 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Constraints)
00288 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip)
00289 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::ComponentTypes)
00290
00291 #endif // multiple inclusion guard