homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h
changeset 62 341166945d65
parent 55 03646e8da489
child 69 87476091b3f5
equal deleted inserted replaced
57:2e2dc3d30ca8 62:341166945d65
    16 */
    16 */
    17 
    17 
    18 #ifndef HSDOMAINMODELDATASTRUCTURES_H
    18 #ifndef HSDOMAINMODELDATASTRUCTURES_H
    19 #define HSDOMAINMODELDATASTRUCTURES_H
    19 #define HSDOMAINMODELDATASTRUCTURES_H
    20 
    20 
    21 #include <QRectF>
    21 #include <QPointF>
       
    22 
    22 #include "hsdomainmodel_global.h"
    23 #include "hsdomainmodel_global.h"
    23 #include <HbFeedback>
       
    24 #include <QMetaEnum>
       
    25 
    24 
    26 class HSDOMAINMODEL_EXPORT HsSceneData
    25 class HSDOMAINMODEL_EXPORT HsSceneData
    27 {
    26 {
    28 public:
    27 public:
    29     HsSceneData() 
    28     HsSceneData() 
    30       : id(-1)
    29       : id(-1)
    31     {}
    30     {}
    32     
    31     
    33     int     id;
    32     int     id;
    34     QString portraitWallpaper;
       
    35     QString landscapeWallpaper;
       
    36 
       
    37 };
    33 };
    38 
    34 
    39 class HSDOMAINMODEL_EXPORT HsPageData
    35 class HSDOMAINMODEL_EXPORT HsPageData
    40 {
    36 {
    41 public:
    37 public:
    84     qreal   y;
    80     qreal   y;
    85     qreal   zValue;
    81     qreal   zValue;
    86     int     widgetId;
    82     int     widgetId;
    87 };
    83 };
    88 
    84 
    89 class HSDOMAINMODEL_EXPORT HsGeneralConfiguration
       
    90 {	
       
    91 public:
       
    92 	int bounceEffect; // pixels, bounce effect reservation, half in left side and half in right side of wallpaper 		
       
    93 	qreal tapAndHoldDistance; // pixels
       
    94     int widgetTapAndHoldTimeout; // ms, duration of long press before action is triggered on widget
       
    95 	int sceneTapAndHoldTimeout; // ms, duration of long press before action is triggered on background
       
    96 	qreal pageChangeZoneWidth; // pixels
       
    97 	qreal pageIndicatorSpacing; // pixels
       
    98     int pageChangeAnimationDuration; // ms, this is how long page change animation takes
       
    99 	int pageChangeZoneAnimationDuration; // ms, this is how long crawling is done before page is actually changed
       
   100     int pageChangeZoneReverseAnimationDuration; // ms, animation duration back to starting position when crawling ends before page is changed
       
   101 	int pageRemovedAnimationDuration; // ms
       
   102 	int newPageAddedAnimationDuration; // ms
       
   103 	int widgetDragEffectDuration; // ms
       
   104 	int widgetDropEffectDuration; // ms
       
   105 	int boundaryFeedbackEffectDistance; // pixels, when widget is moved within n pixels from first page right border or 
       
   106                                         // n pixels from last page's left border, feedback effect is played
       
   107     int defaultPageId; // id of default page (which cannot be removed)
       
   108     int maximumPageCount; // maximum number of pages
       
   109     qreal maximumWidgetHeight; // px
       
   110     qreal maximumWidgetWidth; // px
       
   111     qreal minimumWidgetHeight; // px
       
   112     qreal minimumWidgetWidth; // px
       
   113     bool shortcutLabelsVisible; // display labels under shortcut widgets
       
   114     qreal pageChangePanDistance; // un, amount of pan needed to change page
       
   115 };
       
   116 
       
   117 class HSDOMAINMODEL_EXPORT HsFeedbackConfiguration
       
   118 {
       
   119 public: 
       
   120     HbFeedback::InstantEffect feedbackFromString(const QString &feedback)
       
   121     {
       
   122     int index = HbFeedback::staticMetaObject.indexOfEnumerator("InstantEffect");
       
   123     QMetaEnum metaEnum = HbFeedback::staticMetaObject.enumerator(index);
       
   124 
       
   125     int intFeedback = metaEnum.keysToValue(feedback.toAscii());
       
   126 
       
   127     if (intFeedback < HbFeedback::None || intFeedback > HbFeedback::InstantMaxUser) {
       
   128         return HbFeedback::None;
       
   129     } 
       
   130 
       
   131     return static_cast<HbFeedback::InstantEffect>(intFeedback);
       
   132     }
       
   133 
       
   134 public:
       
   135 	HbFeedback::InstantEffect pageChangeFeedbackType;
       
   136 	HbFeedback::InstantEffect widgetPickFeedbackType;
       
   137 	HbFeedback::InstantEffect widgetDropFeedbackType;
       
   138 	HbFeedback::InstantEffect widgetRepositionFeedbackType;
       
   139 	HbFeedback::InstantEffect widgetOverTrashbinFeedbackType;
       
   140 	HbFeedback::InstantEffect widgetDropToTrashbinFeedbackType;
       
   141 	HbFeedback::InstantEffect shortcutWidgetTapFeedbackType;
       
   142 	HbFeedback::InstantEffect widgetMoveBlockedFeedbackType;
       
   143 	HbFeedback::InstantEffect clockWidgetTapFeedbackType;
       
   144 	HbFeedback::InstantEffect widgetSnappingFeedbackType;
       
   145 };
       
   146 
       
   147 class HSDOMAINMODEL_EXPORT HsSnapConfiguration
       
   148 {	
       
   149 public:
       
   150 	bool snappingEnabled; // variable to tell if snapping is enabled or not
       
   151 	qreal snapForce; // this is the distance at which the widget starts being attracted to the line
       
   152 	qreal snapGap; // the gap at which the objects settle into from each other when they snap
       
   153 	qreal borderGap; // (the gap from the border edges when the widget settles on the edges of the page
       
   154 	int timeout; // time in milliseconds after which the snapping line will be shown
       
   155 };
       
   156 
       
   157 #endif // HSDOMAINMODELDATASTRUCTURES_H
    85 #endif // HSDOMAINMODELDATASTRUCTURES_H