browserui/browser/FavouritesInc/BrowserFavouritesSelectionState.inl
branchRCL_3
changeset 65 8e6fa1719340
equal deleted inserted replaced
64:6385c4c93049 65:8e6fa1719340
       
     1 /*
       
     2 * Copyright (c) 2002 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 the License "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: 
       
    15 *      Inline methods for CWmlBrowserFavouritesSelectionState.
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef BROWSER_FAVOURITES_SELECTION_STATE_INL
       
    22 #define BROWSER_FAVOURITES_SELECTION_STATE_INL
       
    23 
       
    24 // ================= MEMBER FUNCTIONS =======================
       
    25 
       
    26 // ---------------------------------------------------------
       
    27 // TBrowserFavouritesSelectionState::TBrowserFavouritesSelectionState
       
    28 // ---------------------------------------------------------
       
    29 //
       
    30 TBrowserFavouritesSelectionState::TBrowserFavouritesSelectionState()
       
    31     {
       
    32     iCurrentFlags = 0;
       
    33     iMarkFlags = 0;
       
    34     iMarkedItemCount = 0;
       
    35     iMarkedFolderCount = 0;
       
    36     iVisibleItemCount = 0;
       
    37     iVisibleFolderCount = 0;
       
    38     }
       
    39 
       
    40 // ---------------------------------------------------------
       
    41 // TBrowserFavouritesSelectionState::IsEmpty
       
    42 // ---------------------------------------------------------
       
    43 //
       
    44 TBool TBrowserFavouritesSelectionState::IsEmpty() const
       
    45     {
       
    46     return !(iCurrentFlags & EAny);
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------
       
    50 // TBrowserFavouritesSelectionState::AnyMarked
       
    51 // ---------------------------------------------------------
       
    52 //
       
    53 TBool TBrowserFavouritesSelectionState::AnyMarked() const
       
    54     {
       
    55     return iMarkFlags & EAny;
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------
       
    59 // TBrowserFavouritesSelectionState::CurrentIsMarked
       
    60 // ---------------------------------------------------------
       
    61 //
       
    62 TBool TBrowserFavouritesSelectionState::CurrentIsMarked() const
       
    63     {
       
    64     return iMarkFlags & ECurrent;
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------
       
    68 // TBrowserFavouritesSelectionState::AllIsMarked
       
    69 // ---------------------------------------------------------
       
    70 //
       
    71 TBool TBrowserFavouritesSelectionState::AllIsMarked() const
       
    72     {
       
    73     return iMarkFlags & EAll;
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------
       
    77 // TBrowserFavouritesSelectionState::NoneIsMarked
       
    78 // ---------------------------------------------------------
       
    79 //
       
    80 TBool TBrowserFavouritesSelectionState::NoneIsMarked() const
       
    81     {
       
    82     return !AnyMarked();
       
    83     }
       
    84 
       
    85 // ---------------------------------------------------------
       
    86 // TBrowserFavouritesSelectionState::NoItemsMarked
       
    87 // ---------------------------------------------------------
       
    88 //
       
    89 TBool TBrowserFavouritesSelectionState::NoItemsMarked() const
       
    90     {
       
    91     return !(iMarkFlags & EItem);
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------
       
    95 // TBrowserFavouritesSelectionState::NoFoldersMarked
       
    96 // ---------------------------------------------------------
       
    97 //
       
    98 TBool TBrowserFavouritesSelectionState::NoFoldersMarked() const
       
    99     {
       
   100     return !(iMarkFlags & EFolder);
       
   101     }
       
   102 
       
   103 // ---------------------------------------------------------
       
   104 // TBrowserFavouritesSelectionState::MarkedCount
       
   105 // ---------------------------------------------------------
       
   106 //
       
   107 TInt TBrowserFavouritesSelectionState::MarkedCount() const
       
   108     {
       
   109     return iMarkedItemCount + iMarkedFolderCount;
       
   110     }
       
   111 
       
   112 // ---------------------------------------------------------
       
   113 // TBrowserFavouritesSelectionState::CurrentIsItem
       
   114 // ---------------------------------------------------------
       
   115 //
       
   116 TBool TBrowserFavouritesSelectionState::CurrentIsItem() const
       
   117     {
       
   118     return iCurrentFlags & EItem;
       
   119     }
       
   120 
       
   121 // ---------------------------------------------------------
       
   122 // TBrowserFavouritesSelectionState::CurrentIsFolder
       
   123 // ---------------------------------------------------------
       
   124 //
       
   125 TBool TBrowserFavouritesSelectionState::CurrentIsFolder() const
       
   126     {
       
   127     return iCurrentFlags & EFolder;
       
   128     }
       
   129 
       
   130 // ---------------------------------------------------------
       
   131 // TBrowserFavouritesSelectionState::AnyDeletable
       
   132 // ---------------------------------------------------------
       
   133 //
       
   134 TBool TBrowserFavouritesSelectionState::AnyDeletable() const
       
   135     {
       
   136     return (EPlainItem | EFolder | ELastVisited) &
       
   137         (AnyMarked() ? iMarkFlags : iCurrentFlags);
       
   138     }
       
   139 
       
   140 // ---------------------------------------------------------
       
   141 // TBrowserFavouritesSelectionState::AnyPlainItem
       
   142 // ---------------------------------------------------------
       
   143 //
       
   144 TBool TBrowserFavouritesSelectionState::AnyPlainItem() const
       
   145     {
       
   146     return EPlainItem & (AnyMarked() ? iMarkFlags : iCurrentFlags);
       
   147     }
       
   148 
       
   149 // ---------------------------------------------------------
       
   150 // TBrowserFavouritesSelectionState::CurrentIsSpecial
       
   151 // ---------------------------------------------------------
       
   152 //
       
   153 TBool TBrowserFavouritesSelectionState::CurrentIsSpecial() const
       
   154     {
       
   155     return iCurrentFlags & (EHomepage | EStartPage | ELastVisited);
       
   156     }
       
   157 
       
   158 // ---------------------------------------------------------
       
   159 // TBrowserFavouritesSelectionState::AnyMarkedSpecial
       
   160 // ---------------------------------------------------------
       
   161 //
       
   162 TBool TBrowserFavouritesSelectionState::AnyMarkedSpecial() const
       
   163     {
       
   164     return iMarkFlags & (EHomepage | EStartPage | ELastVisited);
       
   165     }
       
   166 
       
   167 // ---------------------------------------------------------
       
   168 // TBrowserFavouritesSelectionState::CurrentIsStartPage
       
   169 // ---------------------------------------------------------
       
   170 //
       
   171 TBool TBrowserFavouritesSelectionState::CurrentIsStartPage() const
       
   172     {
       
   173     return iCurrentFlags & EStartPage;
       
   174     }
       
   175 #endif
       
   176 
       
   177 // End of file