homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp
author hgs
Mon, 20 Sep 2010 10:19:07 +0300
changeset 90 3ac3aaebaee5
parent 86 e4f038c420f7
child 97 66b5fe3c07fd
permissions -rw-r--r--
201037
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
 * All rights reserved.
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
 *
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
 * Initial Contributors:
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
 *
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
 * Contributors:
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
 *
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
 * Description: Menu collection state.
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
 *
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
 */
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
63
hgs
parents: 62
diff changeset
    18
#include <QStateMachine>
hgs
parents: 62
diff changeset
    19
#include <HbAction>
hgs
parents: 62
diff changeset
    20
#include <HbView>
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    21
#include <HbGroupBox>
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    22
#include <HbListView>
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
    23
#include <HbPushButton>
63
hgs
parents: 62
diff changeset
    24
#include <HbAbstractViewItem>
hgs
parents: 62
diff changeset
    25
#include <HbMenu>
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
63
hgs
parents: 62
diff changeset
    27
#include <cadefs.h>
hgs
parents: 62
diff changeset
    28
#include <caentry.h>
69
hgs
parents: 63
diff changeset
    29
#include <caitemmodel.h>
63
hgs
parents: 62
diff changeset
    30
hgs
parents: 62
diff changeset
    31
#include "hsapp_defs.h"
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
#include "hsmenuevent.h"
63
hgs
parents: 62
diff changeset
    33
#include "hsmenueventfactory.h"
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
#include "hsmenuservice.h"
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    35
#include "hsmenumodewrapper.h"
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
#include "hsmenuitemmodel.h"
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
#include "hscollectionstate.h"
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
#include "hsaddappstocollectionstate.h"
71
hgs
parents: 69
diff changeset
    39
#include "hsapplibstateutils.h"
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    40
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    41
/*!
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    42
 \class HsCollectionState
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    43
 \ingroup group_hsmenustateplugin
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    44
 \brief Collection State.
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    45
 Displays a concrete collection.
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    46
 \lib ?library
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    47
 \see StateMachine
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    48
 */
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    49
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    50
/*!
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    51
 \var HsCollectionState::mSortAttribute
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    52
 Sort order.
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    53
 */
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    54
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    55
/*!
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    56
 \var HsCollectionState::mCollectionId
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    57
 The id of the current collection.
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    58
 */
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    59
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    60
/*!
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    61
 \var HsCollectionState::mCollectionType
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    62
 The type of the current collection.
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    63
 */
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    64
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    65
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    66
/*!
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    67
  \fn void HsCollectionState::sortOrderChanged(SHsSortAttribute sortOrder);
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    68
  This signal is emitted when sort order is changed to \a sortOrder.
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    69
  \param sortAttribute sort attribute
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    70
 */
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    71
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    72
/*!
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    73
  \fn void HsCollectionState::constructMenu(bool isDynamic);
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    74
  Set up Menu.
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    75
  \param isDynamic Decides which options should be added to menu.
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    76
 */
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    77
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    78
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    79
 Constructor.
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    80
 \param menuViewBuilder Menu view builder.
63
hgs
parents: 62
diff changeset
    81
 \param menuMode menu mode object (add mode on/add mode off).
hgs
parents: 62
diff changeset
    82
 \param mainWindow main window wrapper.
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    83
 \param parent Owner.
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    84
*/
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    85
HsCollectionState::HsCollectionState(HsMenuViewBuilder &menuViewBuilder,
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    86
                                     HsMenuModeWrapper &menuMode,
51
4785f57bf3d4 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 46
diff changeset
    87
                                     HsMainWindow &mainWindow,
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
    88
                                     QState *parent) :
63
hgs
parents: 62
diff changeset
    89
    HsBaseViewState(mainWindow, menuMode, parent),
81
hgs
parents: 71
diff changeset
    90
    mSortAttribute(Hs::LatestOnTopHsSortAttribute),
86
hgs
parents: 81
diff changeset
    91
    mCollectionId(-1),
hgs
parents: 81
diff changeset
    92
    mLatestOnTopMenuAction(0),
hgs
parents: 81
diff changeset
    93
    mOldestOnTopMenuAction(0)
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
{
63
hgs
parents: 62
diff changeset
    95
    initialize(menuViewBuilder, HsCollectionContext);
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
    construct();
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    99
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   100
 Constructs contained objects.
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   101
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
void HsCollectionState::construct()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
{
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
    HSMENUTEST_FUNC_ENTRY("HsCollectionState::construct");
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   105
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   106
    const QString parentName =
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   107
        parent() != 0 ? parent()->objectName() : QString("");
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   108
    setObjectName(parentName + "/collectionstate");
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
    HSMENUTEST_FUNC_EXIT("HsCollectionState::construct");
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   113
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   114
 Destructor.
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   115
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
HsCollectionState::~HsCollectionState()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
{
63
hgs
parents: 62
diff changeset
   118
    mMenuView->inactivate();
hgs
parents: 62
diff changeset
   119
    mMenuView->view()->setNavigationAction(NULL);
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   123
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   124
 Sets entry event.
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   125
 \param event entry event.
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   126
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
void HsCollectionState::onEntry(QEvent *event)
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
{
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
    qDebug("HsCollectionState::onEntry()");
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
    HSMENUTEST_FUNC_ENTRY("HsCollectionState::onEntry");
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
    QState::onEntry(event);
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
    if (event->type() == HsMenuEvent::eventType()) {
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
        HsMenuEvent *menuEvent = static_cast<HsMenuEvent *>(event);
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
        QVariantMap data = menuEvent->data();
81
hgs
parents: 71
diff changeset
   136
        mCollectionId = data.value(Hs::itemIdKey).toInt();
hgs
parents: 71
diff changeset
   137
        mCollectionType = data.value(Hs::entryTypeNameKey).toString();
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
    }
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
    HSMENUTEST_FUNC_EXIT("HsCollectionState::onEntry");
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   143
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   144
 Slot invoked when a state is entered.
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   145
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
void HsCollectionState::stateEntered()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
{
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
    HSMENUTEST_FUNC_ENTRY("HsCollectionState::stateEntered");
63
hgs
parents: 62
diff changeset
   149
    if (!mModel) {
hgs
parents: 62
diff changeset
   150
        mModel =
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   151
            HsMenuService::getCollectionModel(
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   152
                mCollectionId, mSortAttribute, mCollectionType);
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
    }
63
hgs
parents: 62
diff changeset
   154
69
hgs
parents: 63
diff changeset
   155
    handleEmptyChange(mModel->rowCount() == 0);
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   156
69
hgs
parents: 63
diff changeset
   157
    makeConnect();
86
hgs
parents: 81
diff changeset
   158
69
hgs
parents: 63
diff changeset
   159
    mMenuView->viewLabel()->setHeading(
hgs
parents: 63
diff changeset
   160
        mModel->root().data(CaItemModel::CollectionTitleRole).toString());
63
hgs
parents: 62
diff changeset
   161
69
hgs
parents: 63
diff changeset
   162
    HsBaseViewState::stateEntered();
63
hgs
parents: 62
diff changeset
   163
    HSMENUTEST_FUNC_EXIT("HsCollectionState::stateEntered");
hgs
parents: 62
diff changeset
   164
}
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   165
63
hgs
parents: 62
diff changeset
   166
/*!
hgs
parents: 62
diff changeset
   167
 Creates and installs menu options for the view
hgs
parents: 62
diff changeset
   168
 */
hgs
parents: 62
diff changeset
   169
void HsCollectionState::setMenuOptions()
hgs
parents: 62
diff changeset
   170
{
hgs
parents: 62
diff changeset
   171
    HSMENUTEST_FUNC_ENTRY("HsAllCollectionsState::setMenuOptions");
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
63
hgs
parents: 62
diff changeset
   173
    EntryFlags flags =
hgs
parents: 62
diff changeset
   174
        mModel->root().data(CaItemModel::FlagsRole).value<EntryFlags> ();
hgs
parents: 62
diff changeset
   175
71
hgs
parents: 69
diff changeset
   176
    mViewOptions->clearActions();
63
hgs
parents: 62
diff changeset
   177
71
hgs
parents: 69
diff changeset
   178
    mViewOptions->addAction(hbTrId("txt_applib_opt_task_switcher"),
63
hgs
parents: 62
diff changeset
   179
                            static_cast<HsBaseViewState*>(this),
36
cdae8c6c3876 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   180
                            SLOT(openTaskSwitcher()));
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
63
hgs
parents: 62
diff changeset
   182
    if (flags & RemovableEntryFlag) {
71
hgs
parents: 69
diff changeset
   183
        mViewOptions->addAction(hbTrId("txt_applib_opt_add_content"), this,
63
hgs
parents: 62
diff changeset
   184
                            SLOT(addAppsAction()));
hgs
parents: 62
diff changeset
   185
    }
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
71
hgs
parents: 69
diff changeset
   187
    mViewOptions->addAction(hbTrId("txt_applib_opt_add_to_home_screen"),
63
hgs
parents: 62
diff changeset
   188
                        this, SLOT(addCollectionShortcutToHomeScreenAction()));
hgs
parents: 62
diff changeset
   189
hgs
parents: 62
diff changeset
   190
    if (flags & RemovableEntryFlag) {
hgs
parents: 62
diff changeset
   191
        if (mModel->rowCount() > 0) {
71
hgs
parents: 69
diff changeset
   192
            mViewOptions->addAction(
63
hgs
parents: 62
diff changeset
   193
                hbTrId("txt_applib_opt_arrange"),
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
                this,
63
hgs
parents: 62
diff changeset
   195
                SLOT(createArrangeCollection()));
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
        }
71
hgs
parents: 69
diff changeset
   197
        mViewOptions->addAction(
63
hgs
parents: 62
diff changeset
   198
            hbTrId("txt_common_opt_rename_item"),
hgs
parents: 62
diff changeset
   199
            this,
hgs
parents: 62
diff changeset
   200
            SLOT(renameAction()));
71
hgs
parents: 69
diff changeset
   201
        mViewOptions->addAction(
63
hgs
parents: 62
diff changeset
   202
            hbTrId("txt_common_opt_delete"),
hgs
parents: 62
diff changeset
   203
            this,
hgs
parents: 62
diff changeset
   204
            SLOT(deleteAction()));
hgs
parents: 62
diff changeset
   205
    }
86
hgs
parents: 81
diff changeset
   206
    if (mCollectionType == Hs::collectionDownloadedTypeName &&
81
hgs
parents: 71
diff changeset
   207
            mModel->rowCount() > 0) {
86
hgs
parents: 81
diff changeset
   208
        mLatestOnTopMenuAction = mViewOptions->addAction(
hgs
parents: 81
diff changeset
   209
                hbTrId("txt_applib_menu_sort_by_latest_on_top"),
hgs
parents: 81
diff changeset
   210
                this, SLOT(latestOnTopMenuAction()));
hgs
parents: 81
diff changeset
   211
        mOldestOnTopMenuAction = mViewOptions->addAction(
hgs
parents: 81
diff changeset
   212
                hbTrId("txt_applib_menu_sort_by_oldest_on_top"),
hgs
parents: 81
diff changeset
   213
                this, SLOT(oldestOnTopMenuAction()));
hgs
parents: 81
diff changeset
   214
90
hgs
parents: 86
diff changeset
   215
        //Default is LatestOnTopHsSortAttribute
hgs
parents: 86
diff changeset
   216
        if(mSortAttribute == Hs::OldestOnTopHsSortAttribute)
86
hgs
parents: 81
diff changeset
   217
        {
hgs
parents: 81
diff changeset
   218
            mOldestOnTopMenuAction->setVisible(false);
90
hgs
parents: 86
diff changeset
   219
        } else {            
hgs
parents: 86
diff changeset
   220
            mLatestOnTopMenuAction->setVisible(false);
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
        }
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
    }
90
hgs
parents: 86
diff changeset
   223
    if (mCollectionType == Hs::collectionDownloadedTypeName) {
hgs
parents: 86
diff changeset
   224
        mViewOptions->addAction(hbTrId("txt_applib_opt_check_software_updates"),
hgs
parents: 86
diff changeset
   225
            static_cast<HsBaseViewState*>(this), SLOT(checkSoftwareUpdates()));
hgs
parents: 86
diff changeset
   226
        mViewOptions->addAction(
hgs
parents: 86
diff changeset
   227
            hbTrId("txt_applib_opt_view_installed_applications"),
hgs
parents: 86
diff changeset
   228
            static_cast<HsBaseViewState*>(this),
hgs
parents: 86
diff changeset
   229
            SLOT(openInstalledViewFromCollection()));
hgs
parents: 86
diff changeset
   230
    }
71
hgs
parents: 69
diff changeset
   231
    mMenuView->view()->setMenu(mViewOptions);
63
hgs
parents: 62
diff changeset
   232
    HSMENUTEST_FUNC_EXIT("HsAllCollectionsState::setMenuOptions");
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   235
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   236
 Slot invoked when a state is exited.
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   237
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
void HsCollectionState::stateExited()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
{
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
    HSMENUTEST_FUNC_ENTRY("HsCollectionState::stateExited");
69
hgs
parents: 63
diff changeset
   241
    mMenuView->disableSearch(false);
63
hgs
parents: 62
diff changeset
   242
    makeDisconnect();
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   243
63
hgs
parents: 62
diff changeset
   244
    delete mModel;
hgs
parents: 62
diff changeset
   245
    mModel = NULL;
81
hgs
parents: 71
diff changeset
   246
    this->mSortAttribute = Hs::NoHsSortAttribute;
63
hgs
parents: 62
diff changeset
   247
62
hgs
parents: 55
diff changeset
   248
    HsBaseViewState::stateExited();
63
hgs
parents: 62
diff changeset
   249
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
    HSMENUTEST_FUNC_EXIT("HsCollectionState::stateExited");
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
    qDebug("CollectionState::stateExited()");
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   254
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   255
 Perform all signal connections.
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   256
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
void HsCollectionState::makeConnect()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
{
63
hgs
parents: 62
diff changeset
   259
    connect(mBackKeyAction, SIGNAL(triggered()),
hgs
parents: 62
diff changeset
   260
            static_cast<HsBaseViewState*>(this), SLOT(openAppLibrary()));
hgs
parents: 62
diff changeset
   261
    connect(mMenuView.data(),
hgs
parents: 62
diff changeset
   262
            SIGNAL(activated(QModelIndex)),
hgs
parents: 62
diff changeset
   263
            static_cast<HsBaseViewState*>(this),
hgs
parents: 62
diff changeset
   264
            SLOT(launchItem(QModelIndex)));
hgs
parents: 62
diff changeset
   265
    connect(mMenuView.data(),
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   266
            SIGNAL(longPressed(HbAbstractViewItem *, QPointF)),
63
hgs
parents: 62
diff changeset
   267
            static_cast<HsBaseViewState*>(this),
hgs
parents: 62
diff changeset
   268
            SLOT(showContextMenu(HbAbstractViewItem *, QPointF)));
69
hgs
parents: 63
diff changeset
   269
    connect(mModel, SIGNAL(modelReset()), SLOT(updateLabel()));
hgs
parents: 63
diff changeset
   270
    connect(mModel, SIGNAL(empty(bool)),this,
hgs
parents: 63
diff changeset
   271
            SLOT(handleEmptyChange(bool)));
hgs
parents: 63
diff changeset
   272
    connect(mModel, SIGNAL(empty(bool)),this,
hgs
parents: 63
diff changeset
   273
            SLOT(lockSearchButton(bool)));
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   276
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   277
 Perform all signal disconnections.
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   278
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
void HsCollectionState::makeDisconnect()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
{
63
hgs
parents: 62
diff changeset
   281
    disconnect(mBackKeyAction, SIGNAL(triggered()),
hgs
parents: 62
diff changeset
   282
               static_cast<HsBaseViewState*>(this), SLOT(openAppLibrary()));
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
63
hgs
parents: 62
diff changeset
   284
    disconnect(mMenuView.data(),
hgs
parents: 62
diff changeset
   285
               SIGNAL(activated(QModelIndex)),
hgs
parents: 62
diff changeset
   286
               static_cast<HsBaseViewState*>(this),
hgs
parents: 62
diff changeset
   287
               SLOT(launchItem(QModelIndex)));
hgs
parents: 62
diff changeset
   288
    disconnect(mMenuView.data(),
hgs
parents: 62
diff changeset
   289
               SIGNAL(longPressed(HbAbstractViewItem *, QPointF)),
hgs
parents: 62
diff changeset
   290
               static_cast<HsBaseViewState*>(this),
hgs
parents: 62
diff changeset
   291
               SLOT(showContextMenu(HbAbstractViewItem *, QPointF)));
69
hgs
parents: 63
diff changeset
   292
    disconnect(mModel, SIGNAL(empty(bool)),this,
hgs
parents: 63
diff changeset
   293
               SLOT(handleEmptyChange(bool)));
hgs
parents: 63
diff changeset
   294
hgs
parents: 63
diff changeset
   295
    disconnect(mModel, SIGNAL(empty(bool)),this,
hgs
parents: 63
diff changeset
   296
               SLOT(lockSearchButton(bool)));
hgs
parents: 63
diff changeset
   297
hgs
parents: 63
diff changeset
   298
    disconnect(mModel, SIGNAL(modelReset()),
hgs
parents: 63
diff changeset
   299
                   this, SLOT(updateLabel()));
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   300
}
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   301
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   302
/*!
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   303
 Handles context menu actions
81
hgs
parents: 71
diff changeset
   304
 \param action action taken in context menu
46
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   305
 */
23b5d6a29cce Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 39
diff changeset
   306
void HsCollectionState::contextMenuAction(HbAction *action)
86
hgs
parents: 81
diff changeset
   307
	{
90
hgs
parents: 86
diff changeset
   308
    const int itemId = mContextModelIndex.data(CaItemModel::IdRole).toInt();
hgs
parents: 86
diff changeset
   309
    
hgs
parents: 86
diff changeset
   310
    if (itemId > 0) {
hgs
parents: 86
diff changeset
   311
        Hs::HsContextAction command = 
hgs
parents: 86
diff changeset
   312
                static_cast<Hs::HsContextAction> (action->data().toInt());
hgs
parents: 86
diff changeset
   313
    
hgs
parents: 86
diff changeset
   314
        if (command == Hs::RemoveFromCollectionContextAction) {
hgs
parents: 86
diff changeset
   315
            machine()->postEvent(
hgs
parents: 86
diff changeset
   316
                HsMenuEventFactory::createRemoveAppFromCollectionEvent(itemId,
hgs
parents: 86
diff changeset
   317
                mCollectionId));
hgs
parents: 86
diff changeset
   318
            HsMenuService::touch(itemId);
hgs
parents: 86
diff changeset
   319
        } else if (
hgs
parents: 86
diff changeset
   320
            command == Hs::AddToCollectionFromCollectionViewContextAction) {
hgs
parents: 86
diff changeset
   321
            machine()->postEvent(
hgs
parents: 86
diff changeset
   322
                HsMenuEventFactory::createAddAppsFromCollectionViewEvent(
hgs
parents: 86
diff changeset
   323
                mCollectionId, itemId));
hgs
parents: 86
diff changeset
   324
            HsMenuService::touch(itemId);
hgs
parents: 86
diff changeset
   325
        } else {
hgs
parents: 86
diff changeset
   326
            HsBaseViewState::contextMenuAction(action);
hgs
parents: 86
diff changeset
   327
        }
86
hgs
parents: 81
diff changeset
   328
    } else {
90
hgs
parents: 86
diff changeset
   329
        closeContextMenu();
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
    }
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   333
/*!
69
hgs
parents: 63
diff changeset
   334
 Handler to be called when model becomes not empty or model becomes empty.
hgs
parents: 63
diff changeset
   335
  \param empty \a true when model becomes empty \a false otherwise.
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   336
 */
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   337
void HsCollectionState::handleEmptyChange(bool empty)
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   338
{
86
hgs
parents: 81
diff changeset
   339
    EntryFlags flags = mModel->root().data(
hgs
parents: 81
diff changeset
   340
            CaItemModel::FlagsRole).value<EntryFlags> ();
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   341
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   342
    if (empty){
86
hgs
parents: 81
diff changeset
   343
        mMenuView->reset(HsEmptyLabelContext);
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   344
    } else {
69
hgs
parents: 63
diff changeset
   345
        mMenuView->reset(HsItemViewContext);
hgs
parents: 63
diff changeset
   346
        mMenuView->setModel(mModel);
hgs
parents: 63
diff changeset
   347
        mMenuView->listView()->scrollTo(
hgs
parents: 63
diff changeset
   348
            mModel->index(0), HbAbstractItemView::PositionAtTop);
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   349
    }
69
hgs
parents: 63
diff changeset
   350
    mMenuView->disableSearch(empty);
hgs
parents: 63
diff changeset
   351
    mMenuView->activate();
63
hgs
parents: 62
diff changeset
   352
    setMenuOptions();
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   353
}
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   354
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   355
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   356
/*!
63
hgs
parents: 62
diff changeset
   357
 Handles lock search button
hgs
parents: 62
diff changeset
   358
  \param lock if true lock search button.
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   359
 */
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   360
void HsCollectionState::lockSearchButton(bool lock)
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   361
{
63
hgs
parents: 62
diff changeset
   362
    mMenuView->disableSearch(lock);
55
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   363
}
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   364
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   365
03646e8da489 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 51
diff changeset
   366
/*!
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   367
 Menu add applications action slot
63
hgs
parents: 62
diff changeset
   368
   \param addApps if true create event for add enties to collection.
hgs
parents: 62
diff changeset
   369
   Parametr use by toggled from HbPushButton
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   370
 */
81
hgs
parents: 71
diff changeset
   371
void HsCollectionState::addAppsAction()
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
{
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
    // Add applications
81
hgs
parents: 71
diff changeset
   374
    machine()->postEvent(
hgs
parents: 71
diff changeset
   375
        HsMenuEventFactory::createAddAppsFromCollectionViewEvent(
hgs
parents: 71
diff changeset
   376
            mCollectionId));
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   377
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   378
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   379
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   380
 Menu add shortcut action slot
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   381
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   382
void HsCollectionState::addCollectionShortcutToHomeScreenAction()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   383
{
81
hgs
parents: 71
diff changeset
   384
    addToHomeScreen(mCollectionId);
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   387
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   388
 Menu rename action slot
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   389
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
void HsCollectionState::renameAction()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
{
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
    machine()->postEvent(HsMenuEventFactory::createRenameCollectionEvent(
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
                             mCollectionId));
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   396
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   397
 Menu delete action slot
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   398
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
void HsCollectionState::deleteAction()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
{
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
    machine()->postEvent(HsMenuEventFactory::createDeleteCollectionEvent(
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
                             mCollectionId));
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
39
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   405
/*!
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   406
 Updates label
4e8ebe173323 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   407
 */
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
void HsCollectionState::updateLabel()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
{
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
    HSMENUTEST_FUNC_ENTRY("HsCollectionState::updateLabel");
63
hgs
parents: 62
diff changeset
   411
    if (mModel) {
hgs
parents: 62
diff changeset
   412
        mMenuView->viewLabel()->setHeading(
hgs
parents: 62
diff changeset
   413
            mModel->root().data(Qt::DisplayRole).toString());
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
    }
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
    HSMENUTEST_FUNC_EXIT("HsCollectionState::updateLabel");
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
/*!
69
hgs
parents: 63
diff changeset
   419
 Method setting context menu options.
63
hgs
parents: 62
diff changeset
   420
 */
hgs
parents: 62
diff changeset
   421
void HsCollectionState::setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags)
hgs
parents: 62
diff changeset
   422
{
69
hgs
parents: 63
diff changeset
   423
    HbAction *openAction = mContextMenu->addAction(hbTrId(
hgs
parents: 63
diff changeset
   424
        "txt_common_menu_open"));
81
hgs
parents: 71
diff changeset
   425
    openAction->setData(Hs::OpenAppContextAction);
71
hgs
parents: 69
diff changeset
   426
    HbAction *addToHomeScreenAction = mContextMenu->addAction(hbTrId(
69
hgs
parents: 63
diff changeset
   427
        "txt_applib_menu_add_to_home_screen"));
81
hgs
parents: 71
diff changeset
   428
    addToHomeScreenAction->setData(Hs::AddToHomeScreenContextAction);
63
hgs
parents: 62
diff changeset
   429
    HbAction *addToCollection = mContextMenu->addAction(hbTrId(
69
hgs
parents: 63
diff changeset
   430
        "txt_applib_menu_add_to_collection"));
81
hgs
parents: 71
diff changeset
   431
    addToCollection->setData(Hs::AddToCollectionFromCollectionViewContextAction);
63
hgs
parents: 62
diff changeset
   432
    HbAction *removeAction(NULL);
hgs
parents: 62
diff changeset
   433
    HbAction *uninstallAction(NULL);
hgs
parents: 62
diff changeset
   434
    HbAction *appSettingsAction(NULL);
hgs
parents: 62
diff changeset
   435
    HbAction *appDetailsAction(NULL);
hgs
parents: 62
diff changeset
   436
    // we do not add remove option in locked collection
hgs
parents: 62
diff changeset
   437
    // check conditions and hide irrelevant menu items
hgs
parents: 62
diff changeset
   438
    EntryFlags rootFlags =
hgs
parents: 62
diff changeset
   439
        mModel->root().data(CaItemModel::FlagsRole).value<
hgs
parents: 62
diff changeset
   440
        EntryFlags> ();
hgs
parents: 62
diff changeset
   441
hgs
parents: 62
diff changeset
   442
    if (rootFlags & RemovableEntryFlag) {
hgs
parents: 62
diff changeset
   443
        removeAction = mContextMenu->addAction(
hgs
parents: 62
diff changeset
   444
                           hbTrId("txt_applib_menu_remove_from_collection"));
81
hgs
parents: 71
diff changeset
   445
        removeAction->setData(Hs::RemoveFromCollectionContextAction);
63
hgs
parents: 62
diff changeset
   446
    }
hgs
parents: 62
diff changeset
   447
hgs
parents: 62
diff changeset
   448
    QSharedPointer<const CaEntry> entry = mModel->entry(item->modelIndex());
hgs
parents: 62
diff changeset
   449
81
hgs
parents: 71
diff changeset
   450
    if (!(entry->attribute(Hs::appSettingsPlugin).isEmpty())) {
63
hgs
parents: 62
diff changeset
   451
        appSettingsAction = mContextMenu->addAction(hbTrId(
hgs
parents: 62
diff changeset
   452
                                                "txt_common_menu_settings"));
81
hgs
parents: 71
diff changeset
   453
        appSettingsAction->setData(Hs::AppSettingContextAction);
63
hgs
parents: 62
diff changeset
   454
    }
hgs
parents: 62
diff changeset
   455
90
hgs
parents: 86
diff changeset
   456
    if ((flags & RemovableEntryFlag)) {
hgs
parents: 86
diff changeset
   457
        uninstallAction = mContextMenu->addAction(hbTrId("txt_common_menu_delete"));
hgs
parents: 86
diff changeset
   458
        uninstallAction->setData(Hs::UninstallContextAction);
hgs
parents: 86
diff changeset
   459
    }
hgs
parents: 86
diff changeset
   460
81
hgs
parents: 71
diff changeset
   461
    if (!(entry->attribute(Hs::componentIdAttributeName).isEmpty()) &&
63
hgs
parents: 62
diff changeset
   462
            (flags & RemovableEntryFlag) ) {
hgs
parents: 62
diff changeset
   463
        appDetailsAction = mContextMenu->addAction(hbTrId(
hgs
parents: 62
diff changeset
   464
                                                "txt_common_menu_details"));
81
hgs
parents: 71
diff changeset
   465
        appDetailsAction->setData(Hs::AppDetailsContextAction);
63
hgs
parents: 62
diff changeset
   466
    }
86
hgs
parents: 81
diff changeset
   467
71
hgs
parents: 69
diff changeset
   468
    addToHomeScreenAction->setVisible(
hgs
parents: 69
diff changeset
   469
        !HsAppLibStateUtils::isCWRTWidgetOnHomeScreen(entry.data()));
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
/*!
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
  A Slot called when an action for sorting (latest
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
  on top) is invoked for Downloaded collection.
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
 */
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
void HsCollectionState::latestOnTopMenuAction()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
{
81
hgs
parents: 71
diff changeset
   478
    mSortAttribute = Hs::LatestOnTopHsSortAttribute;
63
hgs
parents: 62
diff changeset
   479
    mModel->setSort(mSortAttribute);
86
hgs
parents: 81
diff changeset
   480
    mLatestOnTopMenuAction->setVisible(false);
hgs
parents: 81
diff changeset
   481
    mOldestOnTopMenuAction->setVisible(true);
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
/*!
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
  A Slot called when an action for sorting (oldest
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
  on top) is invoked for Downloaded collection.
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
 */
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
void HsCollectionState::oldestOnTopMenuAction()
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
{
81
hgs
parents: 71
diff changeset
   490
    mSortAttribute = Hs::OldestOnTopHsSortAttribute;
63
hgs
parents: 62
diff changeset
   491
    mModel->setSort(mSortAttribute);
86
hgs
parents: 81
diff changeset
   492
    mLatestOnTopMenuAction->setVisible(true);
hgs
parents: 81
diff changeset
   493
    mOldestOnTopMenuAction->setVisible(false);
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
}
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
/*!
63
hgs
parents: 62
diff changeset
   497
  A Slot called when an arrange operation
hgs
parents: 62
diff changeset
   498
  is invoked for a static collection.
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
 */
63
hgs
parents: 62
diff changeset
   500
void HsCollectionState::createArrangeCollection()
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   501
{
63
hgs
parents: 62
diff changeset
   502
    // Arrange collection via the Arrange view
hgs
parents: 62
diff changeset
   503
    int topItemId(0);
hgs
parents: 62
diff changeset
   504
69
hgs
parents: 63
diff changeset
   505
    if (mMenuView->listView() != NULL) {
hgs
parents: 63
diff changeset
   506
        const QList<HbAbstractViewItem *> array =
hgs
parents: 63
diff changeset
   507
            mMenuView->listView()->visibleItems();
63
hgs
parents: 62
diff changeset
   508
69
hgs
parents: 63
diff changeset
   509
        if (array.count() >= 1) {
hgs
parents: 63
diff changeset
   510
            QModelIndex idx = array[0]->modelIndex();
hgs
parents: 63
diff changeset
   511
            topItemId = idx.data(CaItemModel::IdRole).toInt();
hgs
parents: 63
diff changeset
   512
        }
63
hgs
parents: 62
diff changeset
   513
    }
hgs
parents: 62
diff changeset
   514
hgs
parents: 62
diff changeset
   515
    machine()->postEvent(
hgs
parents: 62
diff changeset
   516
        HsMenuEventFactory::createArrangeCollectionEvent(
hgs
parents: 62
diff changeset
   517
            topItemId,
hgs
parents: 62
diff changeset
   518
            mCollectionId));
35
f9ce957a272c Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
}
90
hgs
parents: 86
diff changeset
   520
hgs
parents: 86
diff changeset
   521
/*!
hgs
parents: 86
diff changeset
   522
 Triggers event so that an installed applications state is entered.
hgs
parents: 86
diff changeset
   523
 */
hgs
parents: 86
diff changeset
   524
#ifdef COVERAGE_MEASUREMENT
hgs
parents: 86
diff changeset
   525
#pragma CTC SKIP
hgs
parents: 86
diff changeset
   526
#endif //COVERAGE_MEASUREMENT
hgs
parents: 86
diff changeset
   527
void HsCollectionState::openInstalledViewFromCollection()
hgs
parents: 86
diff changeset
   528
{
hgs
parents: 86
diff changeset
   529
    machine()->postEvent(
hgs
parents: 86
diff changeset
   530
        HsMenuEventFactory::createOpenInstalledViewEvent(
hgs
parents: 86
diff changeset
   531
        mCollectionId, mCollectionType));
hgs
parents: 86
diff changeset
   532
}
hgs
parents: 86
diff changeset
   533
#ifdef COVERAGE_MEASUREMENT
hgs
parents: 86
diff changeset
   534
#pragma CTC ENDSKIP
hgs
parents: 86
diff changeset
   535
#endif //COVERAGE_MEASUREMENT