mmuifw_plat/mul_datamodel_api/inc/mul/muldatapath.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Header for MulDataPath
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MULDATAPATH_H
       
    20 #define MULDATAPATH_H
       
    21 
       
    22 #include <memory>
       
    23 #include <osn/osndefines.h>
       
    24 
       
    25 namespace osncore
       
    26     {
       
    27     class UString;  
       
    28     }
       
    29 using namespace osncore;
       
    30 
       
    31 namespace Alf
       
    32     {
       
    33     
       
    34 //Forward Declaration
       
    35 class MulDataPathImpl; //store data for MulDataPath class    
       
    36 /**
       
    37  * @class MulDataPath
       
    38  * 
       
    39  * MulDataPath represent hierarchy in data model.
       
    40  * It stores index of node for each depth.
       
    41  */
       
    42 class MulDataPath
       
    43 	{
       
    44 public:
       
    45 	/**
       
    46 	 * Default constructor
       
    47 	 * 
       
    48 	 * By default path will point to root node.
       
    49 	 */
       
    50 	OSN_IMPORT MulDataPath();
       
    51 	
       
    52 	/**
       
    53 	 * Constrctor will create path with depth 1 and store specified index
       
    54 	 * at depth1
       
    55 	 * 
       
    56 	 * @param aIndexForDepth1 Index of node at depth 1
       
    57 	 */
       
    58 	OSN_IMPORT MulDataPath( int aIndexForDepth1 );
       
    59 	
       
    60 	/**
       
    61 	 * Constrctor will create path with depth 2 and store specified index
       
    62 	 * at depth 1 and depth 2
       
    63 	 * 
       
    64 	 * @param aIndexForDepth1 Index of node at depth 1
       
    65  	 * @param aIndexForDepth2 Index of node at depth 2
       
    66 	 */
       
    67 	OSN_IMPORT MulDataPath( int aIndexForDepth1, int aIndexForDepth2);
       
    68 	
       
    69 	/**
       
    70 	 * Copy constructor
       
    71 	 * 
       
    72 	 *  @param aPath Existing path object
       
    73 	 */
       
    74 	OSN_IMPORT MulDataPath(const MulDataPath& aPath);
       
    75 			
       
    76 	/**
       
    77 	 * Destructor
       
    78 	 */
       
    79 	OSN_IMPORT ~MulDataPath();
       
    80 			
       
    81 	/**
       
    82 	 * Create new depth and add specified index at created depth.
       
    83 	 * 
       
    84 	 * @param aIndex position of node at current depth
       
    85 	 */
       
    86 	OSN_IMPORT void Append(int aIndex);
       
    87 		
       
    88 	/**
       
    89 	 * Depth of path
       
    90 	 * 
       
    91 	 * @return Depth
       
    92 	 */
       
    93 	OSN_IMPORT int Depth() const;
       
    94 		
       
    95 	/**
       
    96 	 * Return position/index of node at given depth
       
    97 	 * 
       
    98 	 * @param aDepth Depth of path
       
    99 	 * @return Position/index of node
       
   100 	 */
       
   101 	OSN_IMPORT int operator[]( int aDepth ) const;
       
   102 	
       
   103 	/**
       
   104 	 * Comparisition operator for Path.
       
   105 	 * Comapre that path is less that other path or not
       
   106 	 * 
       
   107 	 * @param aPath path to wich current path need to be compared
       
   108 	 * @return true - if is less ,false otherwise
       
   109 	 */
       
   110 	bool operator<( MulDataPath& aPath);
       
   111 	
       
   112 	/**
       
   113 	 * return position in current depth. For internal use only
       
   114 	 * 
       
   115 	 * @param position in current depth
       
   116 	 */
       
   117 	int Index() const;
       
   118 	
       
   119 	/**
       
   120 	 * Set internal position in current depth
       
   121 	 * 
       
   122 	 * @param aIndex position in current depth
       
   123 	 */
       
   124 	void SetIndex( int aIndex );
       
   125 	
       
   126 	/**
       
   127 	 * Check whather both path are equal or not,
       
   128 	 *
       
   129 	 * 
       
   130 	 * @param aPath Path object to compare with
       
   131 	 * @return true is equals, false other wise
       
   132 	 */
       
   133 	bool operator== ( const MulDataPath& aPath);
       
   134 	
       
   135 	/**
       
   136 	 * Check whather both path are equal or not,For internal use only
       
   137 	 * 
       
   138 	 * @param aPath Path object to compare with
       
   139 	 * @return true is equals, false other wise
       
   140 	 */
       
   141 	bool IsEqual( const MulDataPath& aPath );
       
   142 	
       
   143 	
       
   144 	/**
       
   145 	 * Assignment operator 
       
   146 	 *
       
   147 	 * @param aPath Existing path
       
   148 	 */
       
   149 	void operator= ( MulDataPath aPath );
       
   150 				
       
   151 				
       
   152 private: //data
       
   153 
       
   154 	std::auto_ptr<MulDataPathImpl> mData; //own
       
   155 	};
       
   156 
       
   157 	} //namespace Alf
       
   158 
       
   159 #endif //MULDATAPATH_H
       
   160 
       
   161 //End of file