browserui/browser/FavouritesInc/BrowserFavouritesSelectionState.inl
changeset 0 84ad3b177aa3
child 11 16a119033e3e
equal deleted inserted replaced
-1:000000000000 0:84ad3b177aa3
       
     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     }
       
    38 
       
    39 // ---------------------------------------------------------
       
    40 // TBrowserFavouritesSelectionState::IsEmpty
       
    41 // ---------------------------------------------------------
       
    42 //
       
    43 TBool TBrowserFavouritesSelectionState::IsEmpty() const
       
    44     {
       
    45     return !(iCurrentFlags & EAny);
       
    46     }
       
    47 
       
    48 // ---------------------------------------------------------
       
    49 // TBrowserFavouritesSelectionState::AnyMarked
       
    50 // ---------------------------------------------------------
       
    51 //
       
    52 TBool TBrowserFavouritesSelectionState::AnyMarked() const
       
    53     {
       
    54     return iMarkFlags & EAny;
       
    55     }
       
    56 
       
    57 // ---------------------------------------------------------
       
    58 // TBrowserFavouritesSelectionState::CurrentIsMarked
       
    59 // ---------------------------------------------------------
       
    60 //
       
    61 TBool TBrowserFavouritesSelectionState::CurrentIsMarked() const
       
    62     {
       
    63     return iMarkFlags & ECurrent;
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------
       
    67 // TBrowserFavouritesSelectionState::AllIsMarked
       
    68 // ---------------------------------------------------------
       
    69 //
       
    70 TBool TBrowserFavouritesSelectionState::AllIsMarked() const
       
    71     {
       
    72     return iMarkFlags & EAll;
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------
       
    76 // TBrowserFavouritesSelectionState::NoneIsMarked
       
    77 // ---------------------------------------------------------
       
    78 //
       
    79 TBool TBrowserFavouritesSelectionState::NoneIsMarked() const
       
    80     {
       
    81     return !AnyMarked();
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------
       
    85 // TBrowserFavouritesSelectionState::NoItemsMarked
       
    86 // ---------------------------------------------------------
       
    87 //
       
    88 TBool TBrowserFavouritesSelectionState::NoItemsMarked() const
       
    89     {
       
    90     return !(iMarkFlags & EItem);
       
    91     }
       
    92 
       
    93 // ---------------------------------------------------------
       
    94 // TBrowserFavouritesSelectionState::NoFoldersMarked
       
    95 // ---------------------------------------------------------
       
    96 //
       
    97 TBool TBrowserFavouritesSelectionState::NoFoldersMarked() const
       
    98     {
       
    99     return !(iMarkFlags & EFolder);
       
   100     }
       
   101 
       
   102 // ---------------------------------------------------------
       
   103 // TBrowserFavouritesSelectionState::MarkedCount
       
   104 // ---------------------------------------------------------
       
   105 //
       
   106 TInt TBrowserFavouritesSelectionState::MarkedCount() const
       
   107     {
       
   108     return iMarkedItemCount + iMarkedFolderCount;
       
   109     }
       
   110 
       
   111 // ---------------------------------------------------------
       
   112 // TBrowserFavouritesSelectionState::CurrentIsItem
       
   113 // ---------------------------------------------------------
       
   114 //
       
   115 TBool TBrowserFavouritesSelectionState::CurrentIsItem() const
       
   116     {
       
   117     return iCurrentFlags & EItem;
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------
       
   121 // TBrowserFavouritesSelectionState::CurrentIsFolder
       
   122 // ---------------------------------------------------------
       
   123 //
       
   124 TBool TBrowserFavouritesSelectionState::CurrentIsFolder() const
       
   125     {
       
   126     return iCurrentFlags & EFolder;
       
   127     }
       
   128 
       
   129 // ---------------------------------------------------------
       
   130 // TBrowserFavouritesSelectionState::AnyDeletable
       
   131 // ---------------------------------------------------------
       
   132 //
       
   133 TBool TBrowserFavouritesSelectionState::AnyDeletable() const
       
   134     {
       
   135     return (EPlainItem | EFolder | ELastVisited) &
       
   136         (AnyMarked() ? iMarkFlags : iCurrentFlags);
       
   137     }
       
   138 
       
   139 // ---------------------------------------------------------
       
   140 // TBrowserFavouritesSelectionState::AnyPlainItem
       
   141 // ---------------------------------------------------------
       
   142 //
       
   143 TBool TBrowserFavouritesSelectionState::AnyPlainItem() const
       
   144     {
       
   145     return EPlainItem & (AnyMarked() ? iMarkFlags : iCurrentFlags);
       
   146     }
       
   147 
       
   148 // ---------------------------------------------------------
       
   149 // TBrowserFavouritesSelectionState::CurrentIsSpecial
       
   150 // ---------------------------------------------------------
       
   151 //
       
   152 TBool TBrowserFavouritesSelectionState::CurrentIsSpecial() const
       
   153     {
       
   154     return iCurrentFlags & (EHomepage | EStartPage | ELastVisited);
       
   155     }
       
   156 
       
   157 // ---------------------------------------------------------
       
   158 // TBrowserFavouritesSelectionState::AnyMarkedSpecial
       
   159 // ---------------------------------------------------------
       
   160 //
       
   161 TBool TBrowserFavouritesSelectionState::AnyMarkedSpecial() const
       
   162     {
       
   163     return iMarkFlags & (EHomepage | EStartPage | ELastVisited);
       
   164     }
       
   165 
       
   166 // ---------------------------------------------------------
       
   167 // TBrowserFavouritesSelectionState::CurrentIsStartPage
       
   168 // ---------------------------------------------------------
       
   169 //
       
   170 TBool TBrowserFavouritesSelectionState::CurrentIsStartPage() const
       
   171     {
       
   172     return iCurrentFlags & EStartPage;
       
   173     }
       
   174 #endif
       
   175 
       
   176 // End of file