locationcentre/lcutils/inc/lcipcparams.inl
branchRCL_3
changeset 16 4721bd00d3da
parent 14 3a25f69541ff
child 21 e15b7f06eba6
equal deleted inserted replaced
14:3a25f69541ff 16:4721bd00d3da
     1 /*
       
     2 * Copyright (c) 2007 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:  Parameters for the IPC message handling between the 
       
    15 *                Location Centre API and Location Centre Server.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // ----- Member funtions for CLcBasicAppInfo ------------------------------
       
    21 
       
    22 // ---------------------------------------------------------------------------
       
    23 // CLcBasicAppInfo::CLcBasicAppInfo
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 inline CLcBasicAppInfo::CLcBasicAppInfo()
       
    27     {
       
    28     // C++ Default constructor. No allocations or functions which can Leave
       
    29     // should be called from here.
       
    30     }
       
    31                          
       
    32 // ---------------------------------------------------------------------------
       
    33 // CLcBasicAppInfo::~CLcBasicAppInfo
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 inline CLcBasicAppInfo::~CLcBasicAppInfo()
       
    37     {
       
    38     // C++ Destructor. Free all resources associated with this class.
       
    39     
       
    40     // Delete the Application data content
       
    41     delete iAppData;
       
    42     
       
    43     // Delete the buffer containing the command line arguments
       
    44     delete iCmdLineParams;
       
    45     }
       
    46         
       
    47 // ---------------------------------------------------------------------------
       
    48 // CLcBasicAppInfo* CLcBasicAppInfo::NewL
       
    49 // ---------------------------------------------------------------------------
       
    50 //
       
    51 inline CLcBasicAppInfo* CLcBasicAppInfo::NewL()
       
    52     {
       
    53     return  ( new ( ELeave ) CLcBasicAppInfo );        
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // CLcBasicAppInfo* CLcBasicAppInfo::NewLC
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 inline CLcBasicAppInfo* CLcBasicAppInfo::NewLC()
       
    61     {
       
    62     CLcBasicAppInfo* self = new ( ELeave ) CLcBasicAppInfo;
       
    63     CleanupStack::PushL( self );
       
    64     return self;        
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // TUint32 CLcBasicAppInfo::ApplicationType
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 inline TUint32 CLcBasicAppInfo::ApplicationType() const
       
    72     {
       
    73     return iAppType;
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // void CLcBasicAppInfo::SetApplicationType
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 inline void CLcBasicAppInfo::SetApplicationType( TUint32      aAppType )
       
    81     {
       
    82     iAppType = aAppType;
       
    83     }
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // TUint32 CLcBasicAppInfo::LocationApplicationIconL
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 inline TUint32 CLcBasicAppInfo::LaunchMode() const
       
    90     {
       
    91     return iLaunchMode;
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // void CLcBasicAppInfo::SetLocationApplicationLaunchMode
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 inline void CLcBasicAppInfo::SetLaunchMode( TUint32  aLaunchMode )
       
    99     {
       
   100     iLaunchMode = aLaunchMode;
       
   101     }
       
   102         
       
   103 // ---------------------------------------------------------------------------
       
   104 // TPtrC CLcBasicAppInfo::ApplicationData
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107 inline TPtrC CLcBasicAppInfo::ApplicationData() const
       
   108     {
       
   109     // Check whether the application data exists, incase it doesnt exist then
       
   110     // return a NULL string else return Application data.
       
   111     if ( iAppData )
       
   112         {
       
   113         return *iAppData;
       
   114         }
       
   115     else
       
   116         {
       
   117         return TPtrC();
       
   118         }
       
   119     }
       
   120 
       
   121 // ---------------------------------------------------------------------------
       
   122 // void CLcBasicAppInfo::ApplicationData
       
   123 // ---------------------------------------------------------------------------
       
   124 //
       
   125 inline void CLcBasicAppInfo::SetApplicationDataL( const TDesC&   aAppData )
       
   126     {   
       
   127     delete iAppData;
       
   128     
       
   129     // Copy the Identifier from the Argument Location Application App info.
       
   130     iAppData = aAppData.AllocL();
       
   131     }
       
   132     
       
   133 // ---------------------------------------------------------------------------
       
   134 // TPtrC CLcBasicAppInfo::CommandLineParameters
       
   135 // ---------------------------------------------------------------------------
       
   136 //
       
   137 inline TPtrC CLcBasicAppInfo::CommandLineParamters() const
       
   138     {
       
   139     // Check whether the command line args exists, incase it doesnt exist then
       
   140     // return a NULL string else return command line arguments.
       
   141     if ( iCmdLineParams )
       
   142         {
       
   143         return *iCmdLineParams;
       
   144         }
       
   145     else
       
   146         {
       
   147         return TPtrC();
       
   148         }
       
   149     }
       
   150 
       
   151 // ---------------------------------------------------------------------------
       
   152 // void CLcBasicAppInfo::SetCommandLineParameters
       
   153 // ---------------------------------------------------------------------------
       
   154 //
       
   155 inline void CLcBasicAppInfo::SetCommandLineParametersL( const TDesC&   aCmdLineParams )
       
   156     {
       
   157     delete iCmdLineParams;
       
   158        
       
   159     // Copy the Identifier from the Argument Location Application App info.
       
   160     iCmdLineParams = aCmdLineParams.AllocL();
       
   161     }    
       
   162     
       
   163 // ----- Member funtions for CLcAppInfo ------------------------------
       
   164 
       
   165 // ---------------------------------------------------------------------------
       
   166 // CLcAppInfo::CLcAppInfo
       
   167 // ---------------------------------------------------------------------------
       
   168 //
       
   169 inline CLcAppInfo::CLcAppInfo()
       
   170     {
       
   171     // C++ Default constructor. No allocations or functions which can Leave
       
   172     // should be called from here.
       
   173     }
       
   174                          
       
   175 // ---------------------------------------------------------------------------
       
   176 // CLcAppInfo::~CLcAppInfo
       
   177 // ---------------------------------------------------------------------------
       
   178 //
       
   179 inline CLcAppInfo::~CLcAppInfo()
       
   180     {
       
   181     // C++ Destructor. Free all resources associated with this class.
       
   182     
       
   183     // Delete the buffer containing the Identifier
       
   184     delete iId;
       
   185     
       
   186     // Delete the buffer containing the name of the Location application
       
   187     delete iApplicationName;
       
   188     
       
   189     // Delete the buffer containing the Icon file name
       
   190     delete iIconFile;
       
   191     }
       
   192         
       
   193 // ---------------------------------------------------------------------------
       
   194 // CLcAppInfo* CLcAppInfo::NewL
       
   195 // ---------------------------------------------------------------------------
       
   196 //
       
   197 inline CLcAppInfo* CLcAppInfo::NewL()
       
   198     {
       
   199     return  ( new ( ELeave ) CLcAppInfo );        
       
   200     }
       
   201 
       
   202 // ---------------------------------------------------------------------------
       
   203 // CLcAppInfo* CLcAppInfo::NewLC
       
   204 // ---------------------------------------------------------------------------
       
   205 //
       
   206 inline CLcAppInfo* CLcAppInfo::NewLC()
       
   207     {
       
   208     CLcAppInfo* self = new ( ELeave ) CLcAppInfo;
       
   209     CleanupStack::PushL( self );
       
   210     return self;        
       
   211     }
       
   212     
       
   213 // ---------------------------------------------------------------------------
       
   214 // TPtrC CLcAppInfo::IdL
       
   215 // ---------------------------------------------------------------------------
       
   216 //
       
   217 inline TPtrC CLcAppInfo::Id() const
       
   218     {
       
   219     // Check whether the UID exists, incase it doesnt exist then return a
       
   220     // NULL string else return the UID.
       
   221     if ( iId )
       
   222         {
       
   223         return *iId;
       
   224         }
       
   225     else
       
   226         {
       
   227         return TPtrC();
       
   228         }
       
   229     }
       
   230     
       
   231 // ---------------------------------------------------------------------------
       
   232 // TUint32 CLcAppInfo::SetIdL
       
   233 // ---------------------------------------------------------------------------
       
   234 //
       
   235 inline void CLcAppInfo::SetIdL( const TDesC& aId )
       
   236     {
       
   237     // Incase, the UID already exists then Leave with KErrAlreadyExists
       
   238     if( iId )
       
   239         {
       
   240         User::Leave( KErrAlreadyExists );
       
   241         }
       
   242         
       
   243     // Copy the Identifier from the Argument Location Application App info.
       
   244     iId = aId.AllocL();
       
   245     
       
   246     }
       
   247         
       
   248  
       
   249 // ---------------------------------------------------------------------------
       
   250 // TPtrC CLcAppInfo::NameL
       
   251 // ---------------------------------------------------------------------------
       
   252 //
       
   253 inline TPtrC CLcAppInfo::Name() const
       
   254     {
       
   255     // Check whether the application name exists, incase it doesnt exist then
       
   256     // return a NULL string else return Application name.
       
   257     if ( iApplicationName )
       
   258         {
       
   259         return *iApplicationName;
       
   260         }
       
   261     else
       
   262         {
       
   263         return TPtrC();
       
   264         } 
       
   265     }
       
   266 
       
   267 // ---------------------------------------------------------------------------
       
   268 // void CLcAppInfo::SetNameL
       
   269 // ---------------------------------------------------------------------------
       
   270 //
       
   271 inline void CLcAppInfo::SetNameL( const TDesC& aName )
       
   272     {
       
   273     // Incase, the application name exists then Leave with KErrAlreadyExists.
       
   274     if( iApplicationName )
       
   275         {
       
   276         User::Leave( KErrAlreadyExists );
       
   277         }
       
   278         
       
   279     // Copy the Name from the Argument Location Application App info.
       
   280     iApplicationName = aName.AllocL();  
       
   281     }  
       
   282 
       
   283 // ---------------------------------------------------------------------------
       
   284 // CLcAppInfo::TLcIconFileType CLcAppInfo::IconFileType
       
   285 // ---------------------------------------------------------------------------
       
   286 //
       
   287 inline CLcAppInfo::TLcIconFileType CLcAppInfo::IconFileType() const
       
   288     {
       
   289     return iIconFileType;
       
   290     }
       
   291 
       
   292 // ---------------------------------------------------------------------------
       
   293 // void CLcAppInfo::SetLocationApplicationLaunchMode
       
   294 // ---------------------------------------------------------------------------
       
   295 //
       
   296 inline void CLcAppInfo::SetIconFileType( 
       
   297                     const CLcAppInfo::TLcIconFileType  aIconFileType )
       
   298     {
       
   299     iIconFileType = aIconFileType;
       
   300     }
       
   301 
       
   302 // ---------------------------------------------------------------------------
       
   303 // TPtrC CLcAppInfo::IconFile
       
   304 // ---------------------------------------------------------------------------
       
   305 //
       
   306 inline TPtrC CLcAppInfo::IconFile() const
       
   307     {
       
   308     // Check whether the icon file exists, incase it doesnt exist then
       
   309     // return a NULL string else return icon file name.
       
   310     if ( iIconFile )
       
   311         {
       
   312         return *iIconFile;
       
   313         }
       
   314     else
       
   315         {
       
   316         return TPtrC();
       
   317         } 
       
   318     }
       
   319 
       
   320 // ---------------------------------------------------------------------------
       
   321 // void CLcAppInfo::SetIconFileL
       
   322 // ---------------------------------------------------------------------------
       
   323 //
       
   324 inline void CLcAppInfo::SetIconFileL( const TDesC& aIconFileType )
       
   325     {
       
   326     // Incase, the icon file exists then Leave with KErrAlreadyExists.
       
   327     if( iIconFile )
       
   328         {
       
   329         User::Leave( KErrAlreadyExists );
       
   330         }
       
   331         
       
   332     // Copy the Name from the Argument Location Application App info.
       
   333     iIconFile = aIconFileType.AllocL();  
       
   334     }
       
   335 
       
   336 // ---------------------------------------------------------------------------
       
   337 // TUint32 CLcAppInfo::FrameNo
       
   338 // ---------------------------------------------------------------------------
       
   339 //
       
   340 inline TUint32 CLcAppInfo::FrameNo() const
       
   341     {
       
   342     return iFrameNo;
       
   343     }
       
   344 
       
   345 // ---------------------------------------------------------------------------
       
   346 // void CLcAppInfo::SetFrameNo
       
   347 // ---------------------------------------------------------------------------
       
   348 //
       
   349 inline void CLcAppInfo::SetFrameNo( TUint32  aFrameNo )
       
   350     {
       
   351     iFrameNo = aFrameNo;
       
   352     }
       
   353     
       
   354 // ---------------------------------------------------------------------------
       
   355 // TUint32 CLcAppInfo::SystemCharacteristics
       
   356 // ---------------------------------------------------------------------------
       
   357 // 
       
   358 inline TUint32 CLcAppInfo::SystemCharacteristics() const
       
   359     {
       
   360     return iSystemCharacteristics;
       
   361     }
       
   362 
       
   363 // ---------------------------------------------------------------------------
       
   364 // void CLcAppInfo::SetSystemCharacteristics
       
   365 // ---------------------------------------------------------------------------
       
   366 //    
       
   367 inline void CLcAppInfo::SetSystemCharacteristics( 
       
   368                             TUint32   aSysCharacteristics )
       
   369     {
       
   370     iSystemCharacteristics = aSysCharacteristics;
       
   371     } 
       
   372      
       
   373 // ---------------------------------------------------------------------------
       
   374 // TUint32 CLcAppInfo::ApplicationCharacteristics
       
   375 // ---------------------------------------------------------------------------
       
   376 // 
       
   377 inline TUint32 CLcAppInfo::ApplicationCharacteristics() const
       
   378     {
       
   379     return iAppCharacteristics;
       
   380     }                           
       
   381 
       
   382 // ---------------------------------------------------------------------------
       
   383 // void CLcAppInfo::SetApplicationCharacteristics
       
   384 // ---------------------------------------------------------------------------
       
   385 //    
       
   386 inline void CLcAppInfo::SetApplicationCharacteristics( 
       
   387                             TUint32   aAppCharacteristics )
       
   388     {
       
   389     iAppCharacteristics |= aAppCharacteristics;
       
   390     }