connectivitymodules/SeCon/cntparser/inc/cntparserserver.h
branchRCL_3
changeset 19 0aa8cc770c8a
parent 18 453dfc402455
child 20 4a793f564d72
equal deleted inserted replaced
18:453dfc402455 19:0aa8cc770c8a
     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 "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:  CCntParserServer header
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CNTPARSERSERVER_H__
       
    20 #define __CNTPARSERSERVER_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32svr.h>
       
    24 
       
    25 class CCntParserCollector;
       
    26 class CContactDatabase;
       
    27 
       
    28 _LIT(KTxtServer,"CntParserServerExe.exe");
       
    29 
       
    30 // needed for creating server thread.
       
    31 const TUint KDefaultHeapSize=0x10000;
       
    32 
       
    33 // reasons for server panic
       
    34 enum TCntParserServerPanic
       
    35 {
       
    36 	EBadRequest,
       
    37 	EBadDescriptor,
       
    38 	EMainSchedulerError,
       
    39 	ESvrCreateServer,
       
    40 	ESvrStartServer,
       
    41 	ECreateTrapCleanup,
       
    42 	ENotImplementedYet,
       
    43 };
       
    44 
       
    45 
       
    46 //**********************************
       
    47 //CCntParserServer
       
    48 //**********************************
       
    49 class CCntParserServer : public CServer2
       
    50 {
       
    51 	public:
       
    52 	IMPORT_C static CCntParserServer* NewL();
       
    53 	IMPORT_C virtual ~CCntParserServer();
       
    54 	static TInt RunServer();
       
    55 	static void RunServerL();
       
    56 	void IncreaseSessionCountL();
       
    57 	void DecreaseSessionCount();
       
    58 	void Stop();
       
    59 	
       
    60 	TInt CreateIrMCL2PhoneBookL(const TDesC& path, TInt aMaxNumberOfContacts,TBool aForced);
       
    61 	void PrepareCollectorL();
       
    62 	TInt ContactsParsed();
       
    63 	void CancelPhoneBookRequest();
       
    64 	void CancelAllPhoneBookRequests();
       
    65 	TInt TotalNumOfContacts();
       
    66 	TInt ContactsSaved();
       
    67 	void Disconnect();
       
    68 	void CompletePhoneBookRequests(TInt aErr);
       
    69 	void SetRequests(TInt aRequests);
       
    70 
       
    71 	protected:
       
    72 	virtual CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMsg) const;
       
    73 
       
    74 
       
    75 	protected:
       
    76 	CCntParserServer();
       
    77 
       
    78 
       
    79 	private:
       
    80 	TInt	iSessionCount;
       
    81 	TInt	iRequests;	//How many PB.VCF requests are ongoing, if 0 collector is canceled
       
    82 
       
    83 	CCntParserCollector* iCollector;
       
    84 	CContactDatabase* iCurrentDatabase;
       
    85 };
       
    86 
       
    87 //**********************************
       
    88 //global functions
       
    89 //**********************************
       
    90 
       
    91 // function to panic the server
       
    92 GLREF_C void PanicServer(TCntParserServerPanic aPanic);
       
    93 
       
    94 
       
    95 #endif