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,
00045 FormFactorConstraint = 1,
00046 LocationConstraint = 2,
00047 ScreenConstraint = 4,
00048 SizeConstraint = 8,
00049 ImmutableConstraint = 16,
00050 StartupCompletedConstraint = 32,
00051 ContextConstraint = 64,
00052 AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint |
00053 SizeConstraint | ImmutableConstraint | ContextConstraint
00054 };
00055 Q_DECLARE_FLAGS(Constraints, Constraint)
00056
00057
00062 enum FormFactor {
00063 Planar = 0,
00068 MediaCenter,
00073 Horizontal,
00075 Vertical
00077 };
00078
00085 enum Direction {
00086 Down = 0,
00087 Up,
00088 Left,
00089 Right
00090 };
00091
00095 enum ZoomDirection {
00096 ZoomIn = 0,
00097 ZoomOut = 1
00098 };
00099
00104 enum Location {
00105 Floating = 0,
00107 Desktop,
00109 FullScreen,
00110 TopEdge,
00111 BottomEdge,
00112 LeftEdge,
00113 RightEdge
00114 };
00115
00120 enum Position {
00121 LeftPositioned,
00122 RightPositioned,
00123 TopPositioned,
00124 BottomPositioned,
00125 CenterPositioned
00126 };
00127
00133 enum PopupPlacement {
00134 FloatingPopup = 0,
00135 TopPosedLeftAlignedPopup,
00137 TopPosedRightAlignedPopup,
00139 LeftPosedTopAlignedPopup,
00141 LeftPosedBottomAlignedPopup,
00143 BottomPosedLeftAlignedPopup,
00145 BottomPosedRightAlignedPopup,
00147 RightPosedTopAlignedPopup,
00149 RightPosedBottomAlignedPopup
00151 };
00152
00156 enum FlipDirection {
00157 NoFlip = 0,
00158 HorizontalFlip = 1,
00159 VerticalFlip = 2
00160 };
00161 Q_DECLARE_FLAGS(Flip, FlipDirection)
00162
00163
00166 enum ZoomLevel {
00167 DesktopZoom = 0,
00169 GroupZoom,
00171 OverviewZoom
00172 };
00173
00177 enum IntervalAlignment {
00178 NoAlignment = 0,
00179 AlignToMinute,
00180 AlignToHour
00181 };
00182
00183 enum ItemTypes {
00184 AppletType = QGraphicsItem::UserType + 1,
00185 LineEditType = QGraphicsItem::UserType + 2
00186 };
00187
00193 enum ImmutabilityType {
00194 Mutable = 1,
00195 UserImmutable = 2,
00197 SystemImmutable = 4
00199 };
00200
00204 enum AspectRatioMode {
00205 InvalidAspectRatioMode = -1,
00208 IgnoreAspectRatio = 0,
00209 KeepAspectRatio = 1,
00210 Square = 2,
00211 ConstrainedSquare = 3,
00214 FixedSize = 4
00215 };
00216
00221 enum ComponentType {
00222 AppletComponent = 1,
00223 DataEngineComponent = 2,
00224 RunnerComponent = 4,
00225 AnimatorComponent = 8,
00226 ContainmentComponent = 16
00227 };
00228 Q_DECLARE_FLAGS(ComponentTypes, ComponentType)
00229
00230 enum MarginEdge {
00231 TopMargin = 0,
00232 BottomMargin,
00233 LeftMargin,
00234 RightMargin
00235 };
00236
00240 PLASMA_EXPORT qreal scalingFactor(ZoomLevel level);
00241
00249 PLASMA_EXPORT Direction locationToDirection(Location location);
00250
00257 PLASMA_EXPORT QGraphicsView *viewFor(const QGraphicsItem *item);
00258
00259 }
00260
00261 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Constraints)
00262 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip)
00263 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::ComponentTypes)
00264
00265 #endif // multiple inclusion guard