sftemplateswizard/com.nokia.s60tools.templates.tests/data/templates/source_template.cpp
changeset 0 61163b28edca
equal deleted inserted replaced
-1:000000000000 0:61163b28edca
       
     1 /*
       
     2 * ============================================================================
       
     3 *  Name        : ?filename.cpp
       
     4 *  Part of     : ?Subsystem_name / ?Module_name       *** Info from the SWAD
       
     5 *  Description : ?Description
       
     6 *  Version     : %version: % << Don't touch! Updated by Synergy at check-out.
       
     7 *
       
     8 *  Copyright © ?year-?year Nokia Corporation and/or its subsidiary(-ies).
       
     9 *  All rights reserved.
       
    10 *  This component and the accompanying materials are made available
       
    11 *  under the terms of the License "?License"
       
    12 *  which accompanies this distribution, and is available
       
    13 *  at the URL "?LicenseUrl".
       
    14 *
       
    15 *  Initial Contributors:
       
    16 *  ?Company_name - initial contribution.
       
    17 *
       
    18 *  Contributors:
       
    19 * 
       
    20 * ============================================================================
       
    21 * Template version: 4.1
       
    22 */
       
    23 
       
    24 *** INSTRUCTIONS TO THE TEMPLATE USER:
       
    25 
       
    26 *** This template follows the S60 coding conventions
       
    27 *** (S60_Coding_Conventions.doc).  Remove all unneeded declarations
       
    28 *** and definitions before checking the file in!  Also remove the
       
    29 *** template's usage instructions, that is, everything that begins
       
    30 *** with "***".
       
    31 
       
    32 *** The copyright years should be < the year of the file's creation >
       
    33 *** - < the year of the file's latest update >.
       
    34 
       
    35 *** Words that begin with "?" are for you to replace with your own
       
    36 *** identifiers, filenames, comments, or code.  ?EXPORT_C means either
       
    37 *** the EXPORT_C visibility directive, or nothing, depending on whether
       
    38 *** the function is to be exported or not.
       
    39 
       
    40 *** To support building on Linux, use only forward slashes in include
       
    41 *** directives.  Also, all filenames and pathnames must be completely
       
    42 *** in lowercase.
       
    43 
       
    44 *** Indent four spaces per step, using spaces, not tabs, to display
       
    45 *** the code consistently across different editors.
       
    46 
       
    47 
       
    48 *** Implement only one class in one file.
       
    49 
       
    50 
       
    51 *** system include files go here:
       
    52 
       
    53 #include <?include_file>
       
    54 
       
    55 *** user include files go here:
       
    56 
       
    57 #include "?include_file"
       
    58 
       
    59 *** external function prototypes go here:
       
    60 
       
    61 extern ?external_function( ?arg_type, ?arg_type );
       
    62 
       
    63 *** local constants go here:
       
    64 
       
    65 const ?type ?constant_var = ?constant;
       
    66 
       
    67 
       
    68 // ======== LOCAL FUNCTIONS ========
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // ?description
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 ?type ?function_name( ?arg_type ?arg,
       
    75                       ?arg_type ?arg )
       
    76     {
       
    77     ?code  // ?implementation comment on this line
       
    78     // ?implementation comment on the following statement or block:
       
    79     ?code
       
    80     }
       
    81 
       
    82 
       
    83 // ======== MEMBER FUNCTIONS ========
       
    84 
       
    85 *** In the same order as defined in the header file.
       
    86 
       
    87 *** The first function includes examples of correct tabulation of some
       
    88 *** commonly used statements, and some suggested places to put
       
    89 *** implementation comments, if needed.
       
    90 
       
    91 // ---------------------------------------------------------------------------
       
    92 // ?description_if_needed
       
    93 // ---------------------------------------------------------------------------
       
    94 //
       
    95 ?classname::?classname()
       
    96     {
       
    97     if ( ?condition )
       
    98         {
       
    99         // ?implementation_comment
       
   100         ?code
       
   101         }
       
   102     else
       
   103         {
       
   104         // ?implementation_comment
       
   105         ?code
       
   106         }
       
   107 
       
   108     // ?implementation_comment
       
   109     while ( ?condition )
       
   110         {
       
   111         ?code
       
   112         }
       
   113 
       
   114     // ?implementation_comment
       
   115     for ( ?for_init_statement; ?condition; ?expression )
       
   116         {
       
   117         ?code
       
   118         }
       
   119 
       
   120     // ?implementation_comment
       
   121     switch ( ?condition )
       
   122         {
       
   123         case ?constant:
       
   124             ?code
       
   125             break;
       
   126         case ?constant:
       
   127             ?code
       
   128             // fall-through intended here
       
   129         case ?constant:
       
   130             ?code
       
   131             break;
       
   132         default:
       
   133             ?code
       
   134             break;
       
   135         }
       
   136     }
       
   137 
       
   138 
       
   139 // ---------------------------------------------------------------------------
       
   140 // ?description_if_needed
       
   141 // ---------------------------------------------------------------------------
       
   142 //
       
   143 void ?classname::ConstructL()
       
   144     {
       
   145     ?code
       
   146     }
       
   147 
       
   148 
       
   149 // ---------------------------------------------------------------------------
       
   150 // ?description_if_needed
       
   151 // ---------------------------------------------------------------------------
       
   152 //
       
   153 EXPORT_C ?classname* ?classname::NewL()
       
   154     {
       
   155     ?classname* self = ?classname::NewLC();
       
   156     CleanupStack::Pop( self );
       
   157     return self;
       
   158     }
       
   159 
       
   160 
       
   161 // ---------------------------------------------------------------------------
       
   162 // ?description_if_needed
       
   163 // ---------------------------------------------------------------------------
       
   164 //
       
   165 EXPORT_C ?classname* ?classname::NewLC()
       
   166     {
       
   167     ?classname* self = new( ELeave ) ?classname;
       
   168     CleanupStack::PushL( self );
       
   169     self->ConstructL();
       
   170     return self;
       
   171     }
       
   172 
       
   173 
       
   174 // ---------------------------------------------------------------------------
       
   175 // ?description_if_needed
       
   176 // ---------------------------------------------------------------------------
       
   177 //
       
   178 ?classname::~?classname()
       
   179     {
       
   180     ?code
       
   181     }
       
   182 
       
   183 
       
   184 *** Non-derived function:
       
   185 
       
   186 // ---------------------------------------------------------------------------
       
   187 // ?implementation_description
       
   188 // ---------------------------------------------------------------------------
       
   189 //
       
   190 ?EXPORT_C ?type ?classname::?member_function(
       
   191     ?really_really_really_really_long_arg_type_1 ?really_really_long_arg_1,
       
   192     ?really_really_really_really_long_arg_type_2 ?really_really_long_arg_2 )
       
   193     {
       
   194     ?code
       
   195     }
       
   196 
       
   197 
       
   198 *** Derived function:
       
   199 
       
   200 // ---------------------------------------------------------------------------
       
   201 // From class ?base_class.
       
   202 // ?implementation_description
       
   203 // ---------------------------------------------------------------------------
       
   204 //
       
   205 ?EXPORT_C ?type ?function_name( ?arg_type_1 ?arg_1, ?arg_type_2 ?arg_2 )
       
   206     {
       
   207     ?code
       
   208     }
       
   209 
       
   210 
       
   211 // ======== GLOBAL FUNCTIONS ========
       
   212 
       
   213 *** For an application's UiApp class, functions NewApplication and E32Main
       
   214 *** should go here:
       
   215 
       
   216 // ---------------------------------------------------------------------------
       
   217 // Constructs and returns an application object.
       
   218 // ---------------------------------------------------------------------------
       
   219 //
       
   220 EXPORT_C CApaApplication* NewApplication()
       
   221     {
       
   222     return new ?CMyApplication;
       
   223     }
       
   224 
       
   225 
       
   226 // ---------------------------------------------------------------------------
       
   227 // Main function of the application executable.
       
   228 // ---------------------------------------------------------------------------
       
   229 //
       
   230 GLDEF_C TInt E32Main()
       
   231     {
       
   232     return EikStart::RunApplication( NewApplication );
       
   233     }