phoneuis/bubblemanager2/bubblecore/src/bubblewidgetmanager.h
changeset 21 92ab7f8d0eab
child 27 2f8f8080a020
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Interface to HbDocumentLoader (DocML files).
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef BUBBLEWIDGETMANAGER_H
       
    19 #define BUBBLEWIDGETMANAGER_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QMap>
       
    23 
       
    24 class QGraphicsWidget;
       
    25 class BubbleDocumentLoader;
       
    26 class BubbleHandler;
       
    27 class BubbleButtonStyle;
       
    28 
       
    29 class BubbleWidgetManager : public QObject
       
    30 {
       
    31     Q_OBJECT
       
    32 
       
    33 public:
       
    34     enum View
       
    35     {
       
    36         SingleCallView,
       
    37         TwoCallsView,
       
    38         ThreeCallsView,
       
    39         ConferenceView,
       
    40         MutedOverlay
       
    41     };
       
    42 
       
    43     enum Container
       
    44     {
       
    45         None,
       
    46         ExpandedBubble,
       
    47         CollapsedBubble, // top most when 2 calls
       
    48         CollapsedBubble2 // top most when 3 calls
       
    49     };
       
    50 
       
    51     enum Widget
       
    52     {
       
    53         Heading,
       
    54         Image,
       
    55         LeftButton,
       
    56         CenterButton,
       
    57         RightButton,
       
    58         ConferenceTimer,
       
    59         ParticipantList,
       
    60         ParticipantListItem,
       
    61         ParticipantListButton
       
    62     };
       
    63 
       
    64 public:
       
    65     BubbleWidgetManager(int style, QObject* parent=0);
       
    66     virtual ~BubbleWidgetManager();
       
    67 
       
    68     QGraphicsWidget* view(View view);
       
    69 
       
    70     void releaseView(View view);
       
    71 
       
    72     QGraphicsWidget* container(View view,
       
    73                                Container container) const;
       
    74 
       
    75     QGraphicsWidget* widget(View view,
       
    76                             Container container,
       
    77                             Widget widget) const;
       
    78 
       
    79     QList<BubbleHandler*>* handlers(QGraphicsWidget* widget) const;
       
    80 
       
    81     QGraphicsWidget* createParticipantListItem();
       
    82 
       
    83     void setStylePluginName(const QString& name);
       
    84 
       
    85 public slots:
       
    86     void handleOrientationChange(Qt::Orientation orientation);
       
    87 
       
    88 private:
       
    89     QGraphicsWidget* loadDocument(View view, Qt::Orientation orientation);
       
    90     void createDocumentHandlers(View view);
       
    91     void applyCustomStyles(View view);
       
    92     void setButtonStyle(Widget widget, QGraphicsWidget* button);
       
    93 
       
    94 private:
       
    95     int mStyleBaseId;
       
    96     QString mStylePluginName;
       
    97     Qt::Orientation mOrientation;
       
    98     QMap<int,BubbleDocumentLoader*>  mDocumentLoaders;
       
    99     QMap<int,QList<BubbleHandler*>*> mDocumentHandlers;
       
   100     QMap<int,QGraphicsWidget*>       mDocumentContent;
       
   101 
       
   102     QMap<int,QString> mFileNames;
       
   103     QMap<int,QString> mContainerName;
       
   104     QMap<int,QString> mWidgetPrefix;
       
   105     QMap<int,QString> mWidgetName;
       
   106     QMap<int,QString> mOrientationName;
       
   107     QMap<int,BubbleButtonStyle*> mButtonStyle;
       
   108 };
       
   109 
       
   110 #endif // BUBBLEWIDGETMANAGER_H