src/hbwidgets/popups/hbmessagebox.h
changeset 34 ed14f46c0e55
parent 6 c3690ec91ef8
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    83     void setIconVisible(bool visible);
    83     void setIconVisible(bool visible);
    84     bool  iconVisible() const;
    84     bool  iconVisible() const;
    85 
    85 
    86     void setStandardButtons(StandardButtons buttons);
    86     void setStandardButtons(StandardButtons buttons);
    87     StandardButtons standardButtons() const;
    87     StandardButtons standardButtons() const;
       
    88 
       
    89     QGraphicsItem *primitive(const QString &itemName) const;
    88     
    90     
    89     QGraphicsItem *primitive(HbStyle::Primitive primitive) const;
       
    90     enum { Type = Hb::ItemType_MessageBox };
    91     enum { Type = Hb::ItemType_MessageBox };
    91     int type() const { return Type; }
    92     int type() const { return Type; }
    92 
    93 
    93 public:
    94 public:
    94     static void question(const QString &questionText,
    95     static void question(const QString &questionText,
    97                             const QString &primaryButtonText = tr("Yes"),
    98                             const QString &primaryButtonText = tr("Yes"),
    98                             const QString &secondaryButtonText = tr("No"),
    99                             const QString &secondaryButtonText = tr("No"),
    99                             QGraphicsWidget *headWidget = 0,
   100                             QGraphicsWidget *headWidget = 0,
   100                             QGraphicsScene *scene = 0,
   101                             QGraphicsScene *scene = 0,
   101                             QGraphicsItem *parent = 0 );
   102                             QGraphicsItem *parent = 0 );
   102 	 
   103      
   103     static void information(const QString &informationText,
   104     static void information(const QString &informationText,
   104                             QObject *receiver = 0,
   105                             QObject *receiver = 0,
   105                             const char *member = 0,
   106                             const char *member = 0,
   106                             QGraphicsWidget *headWidget = 0,
   107                             QGraphicsWidget *headWidget = 0,
   107                             QGraphicsScene *scene = 0,
   108                             QGraphicsScene *scene = 0,
   119                             const char *member,
   120                             const char *member,
   120                             HbMessageBox::StandardButtons buttons,
   121                             HbMessageBox::StandardButtons buttons,
   121                             QGraphicsWidget *headingWidget = 0,
   122                             QGraphicsWidget *headingWidget = 0,
   122                             QGraphicsScene *scene = 0,
   123                             QGraphicsScene *scene = 0,
   123                             QGraphicsItem *parent = 0);
   124                             QGraphicsItem *parent = 0);
   124 	 
   125      
   125     static void information(const QString &informationText,
   126     static void information(const QString &informationText,
   126                             QObject *receiver,
   127                             QObject *receiver,
   127                             const char *member,
   128                             const char *member,
   128                             HbMessageBox::StandardButtons buttons ,
   129                             HbMessageBox::StandardButtons buttons ,
   129                             QGraphicsWidget *headingWidget=0,
   130                             QGraphicsWidget *headingWidget=0,
   137                             QGraphicsWidget *headingWidget = 0,
   138                             QGraphicsWidget *headingWidget = 0,
   138                             QGraphicsScene *scene = 0,
   139                             QGraphicsScene *scene = 0,
   139                             QGraphicsItem *parent = 0 );
   140                             QGraphicsItem *parent = 0 );
   140 
   141 
   141 public slots:
   142 public slots:
       
   143     void recreatePrimitives();
   142     void updatePrimitives();
   144     void updatePrimitives();
   143 
   145 
   144 protected:
   146 protected:
       
   147     void showEvent(QShowEvent *event);
   145     HbMessageBox(HbMessageBoxPrivate &dd, QGraphicsItem *parent);
   148     HbMessageBox(HbMessageBoxPrivate &dd, QGraphicsItem *parent);
   146     void initStyleOption(HbStyleOptionMessageBox *option) const;
   149     void initStyleOption(HbStyleOptionMessageBox *option) const;
       
   150     void initPrimitiveData(HbStylePrimitiveData *primitiveData, const QGraphicsObject *primitive);
       
   151     void changeEvent(QEvent *event);
   147 
   152 
   148 private:
   153 private:
   149     Q_PRIVATE_SLOT(d_func(), void _q_buttonClicked())
   154     Q_PRIVATE_SLOT(d_func(), void _q_buttonClicked())
   150     Q_DECLARE_PRIVATE_D(d_ptr, HbMessageBox)
   155     Q_DECLARE_PRIVATE_D(d_ptr, HbMessageBox)
   151     Q_DISABLE_COPY(HbMessageBox)    
   156     Q_DISABLE_COPY(HbMessageBox)    
   152 	
   157     
   153 };
   158 };
   154 Q_DECLARE_OPERATORS_FOR_FLAGS(HbMessageBox::StandardButtons)
   159 Q_DECLARE_OPERATORS_FOR_FLAGS(HbMessageBox::StandardButtons)
   155 
   160 
   156 #endif // HB_MESSAGEBOX_H
   161 #endif // HB_MESSAGEBOX_H
   157 
   162