phoneplugins/infowidgetplugin/infowidgetprovider/infowidget/inc/infowidget.h
changeset 27 2f8f8080a020
parent 22 6bb1b21d2484
equal deleted inserted replaced
22:6bb1b21d2484 27:2f8f8080a020
    18 #ifndef INFOWIDGET_H
    18 #ifndef INFOWIDGET_H
    19 #define INFOWIDGET_H
    19 #define INFOWIDGET_H
    20 
    20 
    21 #include <hbwidget.h>
    21 #include <hbwidget.h>
    22 #include <QGraphicsSceneMouseEvent>
    22 #include <QGraphicsSceneMouseEvent>
       
    23 #include <QList>
    23 #include <QFlags>
    24 #include <QFlags>
    24 #include "infowidgetlayoutmanager.h"
    25 #include "infowidgetlayoutmanager.h"
    25 
    26 
    26 class QLabel;
    27 class QLabel;
    27 class QGraphicsLinearLayout; 
    28 class QGraphicsLinearLayout;
       
    29 class QTranslator; 
    28 class HbDialog;
    30 class HbDialog;
    29 class HbIconItem; 
    31 class HbIconItem; 
    30 class HbMarqueeItem;
    32 class HbMarqueeItem;
    31 class HbLabel; 
    33 class HbLabel; 
    32 class HbCheckBox; 
    34 class HbCheckBox; 
    33 class HbPushButton; 
    35 class HbPushButton;
       
    36 class HbFrameDrawer;
    34 class InfoWidgetEngine; 
    37 class InfoWidgetEngine; 
    35 class InfoWidgetPreferences;
    38 class InfoWidgetPreferences;
       
    39  
    36 
    40 
    37 class InfoWidget : public HbWidget
    41 class InfoWidget : public HbWidget
    38 {
    42 {
    39     Q_OBJECT
    43     Q_OBJECT
    40 
    44 
    46     QRectF boundingRect() const;
    50     QRectF boundingRect() const;
    47     QPainterPath shape() const; 
    51     QPainterPath shape() const; 
    48     QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const;  
    52     QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const;  
    49     QSizePolicy sizePolicy () const;  
    53     QSizePolicy sizePolicy () const;  
    50     
    54     
    51 public: // Property definitions with read and write functions
    55 public: // Property definitions
    52     Q_PROPERTY(QString homeZoneDisplay READ homeZoneDisplay WRITE setHomeZoneDisplay)
    56     Q_PROPERTY(QString homeZoneDisplay READ homeZoneDisplay WRITE setHomeZoneDisplay)
    53     Q_PROPERTY(QString mcnDisplay READ mcnDisplay WRITE setMcnDisplay)
    57     Q_PROPERTY(QString mcnDisplay READ mcnDisplay WRITE setMcnDisplay)
    54     Q_PROPERTY(QString activeLineDisplay READ activeLineDisplay WRITE setActiveLineDisplay)
    58     Q_PROPERTY(QString activeLineDisplay READ activeLineDisplay WRITE setActiveLineDisplay)
    55     Q_PROPERTY(QString satDisplay READ satDisplay WRITE setSatDisplay)
    59     Q_PROPERTY(QString satDisplay READ satDisplay WRITE setSatDisplay)
       
    60     Q_PROPERTY(QString spnDisplay READ spnDisplay WRITE setSpnDisplay)
    56     QString homeZoneDisplay();
    61     QString homeZoneDisplay();
    57     void setHomeZoneDisplay(QString value);
    62     void setHomeZoneDisplay(QString value);
    58     QString mcnDisplay();
    63     QString mcnDisplay();
    59     void setMcnDisplay(QString value);
    64     void setMcnDisplay(QString value);
    60     QString activeLineDisplay();
    65     QString activeLineDisplay();
    61     void setActiveLineDisplay(QString value);
    66     void setActiveLineDisplay(QString value);
    62     QString satDisplay();
    67     QString satDisplay();
    63     void setSatDisplay(QString value);
    68     void setSatDisplay(QString value);
       
    69     QString spnDisplay();
       
    70     void setSpnDisplay(QString value);
    64     
    71     
    65 protected:
    72 protected:
    66     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 
    73     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 
    67     void mousePressEvent(QGraphicsSceneMouseEvent *event);
    74     void mousePressEvent(QGraphicsSceneMouseEvent *event);
    68     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); 
    75     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); 
    69     void mouseMoveEvent(QGraphicsSceneMouseEvent *event); 
    76     void mouseMoveEvent(QGraphicsSceneMouseEvent *event); 
    70     
    77     
    71     void updateInfoDisplay();
    78     void updateInfoDisplay();
    72     void initializePreferences(); 
    79     bool readPersistentPreferences();
    73     
    80     void initializeCheckBoxStates(); 
    74     void changeEvent(QEvent *event);
    81     void changeEvent(QEvent *event);
       
    82     bool installTranslator(QString translationFile); 
       
    83     void removeTranslators(); 
    75     
    84     
    76 private: 
    85 private: 
    77     void updateItemsVisibility();
    86     void updateItemsVisibility();
    78     void layoutInfoDisplay(); 
    87     void layoutInfoDisplay(); 
    79     void layoutSettingsDisplay(); 
    88     void layoutSettingsDisplay(); 
    80     
       
    81     void initializeInfoDisplayItems(); 
    89     void initializeInfoDisplayItems(); 
    82     void initializeSettingsDisplayItems(); 
    90     void initializeSettingsDisplayItems();
    83      
       
    84     void startChanges(); 
    91     void startChanges(); 
    85     void endChanges(); 
    92     void endChanges(); 
    86     
    93 
    87 public slots: 
    94 public slots: 
    88     // Slots from HsWidget
    95     // Slots from HsWidget
    89     void onInitialize();
    96     void onInitialize();
    90     void onUninitialize();
    97     void onUninitialize();
    91     void onShow();
    98     void onShow();
    92     void onHide();
    99     void onHide();
    93 
   100 
    94     // Info widget specific slots 
   101     // Info widget specific slots 
    95     void readModel(); 
   102     void readModel(); 
    96     void handleModelError(int operation,int errorCode);  
   103     void handleModelError(int operation,int errorCode);  
    97     void homeZoneDisplaySettingChanged(int state);
   104     void spnDisplaySettingChanged(int state);
    98     void mcnDisplaySettingChanged(int state);
   105     void mcnDisplaySettingChanged(int state);
    99     void activeLineDisplaySettingChanged(int state);
       
   100     void satDisplaySettingChanged(int state);
   106     void satDisplaySettingChanged(int state);
   101 
       
   102     void settingsEditingFinished();
   107     void settingsEditingFinished();
       
   108     void settingsValidationFailed(); 
   103     
   109     
   104 signals: 
   110 signals: 
   105     void setPreferences(const QStringList &names);
   111     void setPreferences(const QStringList &names);
   106 
   112 
   107 private:
   113 private:
   111     InfoWidgetEngine *m_engine;
   117     InfoWidgetEngine *m_engine;
   112     
   118     
   113     // Widget preference store  
   119     // Widget preference store  
   114     InfoWidgetPreferences *m_preferences;
   120     InfoWidgetPreferences *m_preferences;
   115 
   121 
   116     // Layout for widget
   122     // Layout manager for widget
   117     InfoWidgetLayoutManager *m_layoutManager;    
   123     InfoWidgetLayoutManager *m_layoutManager;
       
   124     
   118     QGraphicsLinearLayout *m_layout; 
   125     QGraphicsLinearLayout *m_layout; 
   119     
   126     QList<QTranslator *> m_translators;
   120     bool m_layoutChanging; 
   127     QColor m_backGroundColor; 
   121     bool m_isDragEvent; 
   128     HbFrameDrawer *m_frameDrawer;
   122     QColor m_backGroundColor;
   129     bool m_layoutChanging;
   123     
   130     bool m_dragEvent; 
       
   131     bool m_initialized;
   124 };
   132 };
   125 
   133 
   126 
   134 
   127 #endif // INFOWIDGET_H
   135 #endif // INFOWIDGET_H
   128 
   136