homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp
changeset 98 e6f74eb7f69f
parent 97 66b5fe3c07fd
equal deleted inserted replaced
97:66b5fe3c07fd 98:e6f74eb7f69f
    26 #include <HbWidget>
    26 #include <HbWidget>
    27 #include <HbStaticVkbHost>
    27 #include <HbStaticVkbHost>
    28 #include <HbMainWindow>
    28 #include <HbMainWindow>
    29 #include <HbInputMethod>
    29 #include <HbInputMethod>
    30 #include <HbToolBarExtension>
    30 #include <HbToolBarExtension>
       
    31 #include <HbGridView>
    31 
    32 
    32 #include "hsmenuviewbuilder.h"
    33 #include "hsmenuviewbuilder.h"
    33 #include "hsmenustates_global.h"
    34 #include "hsmenustates_global.h"
    34 
    35 
    35 static const char* DOCUMENT_BASE_NAME_MAP
    36 static const char* DOCUMENT_BASE_NAME_MAP
    36         [InvalidOperationalContext] =
    37         [InvalidOperationalContext] =
    37                             /*HsItemViewContext,    HsEmptyLabelContext*/
    38                             /*HsItemViewContext,    HsEmptyLabelContext*/
    38 {
    39 {
    39      "labeledlistview",     "emptylabeledview"
    40      "labeledlistview", "emptylabeledview", "labeledgridviewportrait", "labeledgridviewlandscape"
    40 };
    41 };
    41 
    42 
    42 static const QString DOCUMENT_NAME_PREFIX(QLatin1String(":/xml/"));
    43 static const QString DOCUMENT_NAME_PREFIX(QLatin1String(":/xml/"));
    43 static const QString DOCUMENT_NAME_EXT(QLatin1String(".docml"));
    44 static const QString DOCUMENT_NAME_EXT(QLatin1String(".docml"));
    44 static const QString COMMON_OBJECTS_DOCUMENT_BASE_NAME(
    45 static const QString COMMON_OBJECTS_DOCUMENT_BASE_NAME(
    45         QLatin1String("common_objects"));
    46         QLatin1String("common_objects"));
    46 static const QString VIEW_NAME(QLatin1String("view"));
    47 static const QString VIEW_NAME(QLatin1String("view"));
    47 static const QString LIST_VIEW_NAME(QLatin1String("listView"));
    48 static const QString ABSTRACT_ITEM_VIEW(QLatin1String("abstractItemView"));
    48 static const QString VIEW_LABEL_NAME(QLatin1String("label"));
    49 static const QString VIEW_LABEL_NAME(QLatin1String("label"));
    49 
    50 
    50 /*!
    51 /*!
    51     \class HsMenuViewBuilder
    52     \class HsMenuViewBuilder
    52     \ingroup group_hsmenustateplugin
    53     \ingroup group_hsmenustateplugin
    76     }
    77     }
    77     return view;
    78     return view;
    78 }
    79 }
    79 
    80 
    80 /*!
    81 /*!
    81  \return Pointer to list view resulting from last \a build call or NULL if
    82  \return Pointer to abstract item view resulting from last \a build call or NULL if
    82  the \a build has not yet been called.
    83  the \a build has not yet been called.
    83  The pointer is valid until the HsMenuViewBuilder instance is destroyed.
    84  The pointer is valid until the HsMenuViewBuilder instance is destroyed.
    84  Memory ownership is not changed.
    85  Memory ownership is not changed.
    85  */
    86  */
    86 HbListView *HsMenuViewBuilder::currentListView()
    87 HbAbstractItemView *HsMenuViewBuilder::currentAbstractItemView()
    87 {
    88 {
    88     HbListView *const listView =
    89     HbAbstractItemView *const abstractItemView =
    89         qobject_cast<HbListView *>(
    90         qobject_cast<HbAbstractItemView *>(
    90                 currentLoader()->findWidget(LIST_VIEW_NAME));
    91                 currentLoader()->findWidget(ABSTRACT_ITEM_VIEW));
    91 
    92 
    92     return listView;
    93     return abstractItemView;
    93 }
    94 }
    94 
    95 
    95 /*!
    96 /*!
    96  \return Pointer to the view label resulting from last \a build call. It is
    97  \return Pointer to the view label resulting from last \a build call. It is
    97  guaranteed to be not NULL if the \a build was called for the context
    98  guaranteed to be not NULL if the \a build was called for the context