⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ccontcontainer.h

📁 基于symbian OS的IP前缀添加器.可以在通话前为电话加一个IP的功能.
💻 H
字号:
/* Copyright (c) 2003, Nokia. All rights reserved */

#ifndef __CCONTCONTAINER_H__
#define __CCONTCONTAINER_H__

// INCLUDES
#include <coecntrl.h>
#include <eiklbx.h>
#include <aknsfld.h>
#include <aknutils.h>
#include <aknlists.h>
#include <cntdb.h>
#include <badesca.h>
#include <eiktxlbm.h>

// CONSTANTS
#include <etel.h>


#include "ContactsConstants.h"



// CLASS DECLARATION

/**
*  CContContainer container control class.
*
*/
class CContContainer : public CCoeControl,
                              MCoeControlObserver,
                              MEikListBoxObserver
    {

   

       
	public:		
			/**
        * Default constructor
        */
        void ConstructL( const TRect& aRect );
         


		//static CContContainer* NewL(const TRect& aRect);
    	//static CContContainer* NewLC(const TRect& aRect);
        /**
        * Destructor.
        * Destructor is always virtual
        */
        virtual ~CContContainer();

        /**
        * Constructor
        */
        CContContainer();

    public: // New functions

        /**
        * AddNewContactDlgL
        * The method adds new contact
        */
        void AddNewContactDlgL();
        
        /**
        * EditContactDlgL
        * The method edits contact
        */
        void EditContactDlgL();
		//void ShowIPL();
         
        /**
        * DeleteContactDlgL
        * The method deletes contact
        */
        void DeleteContactDlgL();

        /**
        * AddContactToGrpL
        * The method adds contact to selected contact group
        */
       

        /**
        * GetSelectedContactL
        * The method stores selected contact and open group
        * list to the listbox
        */
        void GetSelectedContactL();
 
        /**
        * CreateContactTemplateL
        * The method creates new contact template
        */
        void CreateContactTemplateL();

   
        /**
        * CreateContactDatabaseQueryL
        * The method creates contacts db
        */
        void CreateContactDatabaseQueryL();

		////////////////////////////////////////////////
		void ContactsNullIPL();
		void ContactsYdIPL();
		void ContactsLtIPL();
		 void ContactsSetIPL();
		////////////////////////////////////////////////
                           void HandleListBoxEventL( CEikListBox* /*aListBox */,
    TListBoxEvent aEventType );
        /**
        * DeleteContactDatabaseQueryL
        * The method deletes contacts db
        */
        void DeleteContactDatabaseQueryL();

        /**
        * ShowContactsL
        * The method shows contacts in the listbox
        */
        void ShowContactsL();
         
		//void DeleteContactDlgL();
       
        TBool IsContactsOnListBox();

        /**
        * IfContactDbSelected
        * The method returns true if contacs are opened.
        * @return status of contact database attribute
        */
        TBool IfContactDbSelected();

  
       /**
        * OpenDataBaseQueryL
        * The method opens query display
        */
        void OpenDataBaseQueryL();

        /**
        * OpenDefaultDatabaseL
        * The method opens default contact database
        */
        void OpenDefaultDatabaseL();

        /**
        * CreateContactDatabaseL
        * The method creates contact db to disk
        * @param aDbName name of the contact database
        */
        void CreateContactDatabaseL( TDesC& aDbName );

        /**
        * DeleteContactDatabaseL
        * The method deletes contact db from disk
        * @param aDbName name of the contact database
        */
        void DeleteContactDatabaseL( TDesC& aDbName );

        /**
        * OpenContactDatabaseL
        * The method opens contact db from disk
        * @param aDbName name of the contact database
        */
        void OpenContactDatabaseL( TDesC& aDbName );

        /**
        * OpenContactDatabase
        * The method stores name of the contact database
        * complete path
        * to the variable iDbName
        * @param aDbName name of the contact database
        */
        void UpdateContactDbName( TDesC& aDbName );
       
        /**
        * DatabaseExists
        * The method Checks if contact database is exist
        * @param aDbName name of the contact database
        * @return status of database
        */
        TBool DatabaseExists( TDesC& aDbName );
////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
private: // Functions from base classes

        /**
        * From CoeControl,SizeChanged
        * Called by framework when the view size is changed
        */
        void SizeChanged();

        /**
        * From CoeControl,CountComponentControls
        * @return Number of controls inside this container
        */
        TInt CountComponentControls() const;

        /**
        * From CCoeControl,ComponentControl
        * @param aIndex The index of the control queried
        * @return Pointer to the control queried
        */
        CCoeControl* ComponentControl( TInt aIndex ) const;

        /**
        * From CCoeControl,Draw
        * @param aRect rectangle for drawing
        */
        void Draw( const TRect& aRect ) const;

        /**
        * From CCoeControl
        * event handling section
        * e.g Listbox events
        * @param aControl name of the contact database
        * @param aEventType The event type
        */
        void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
	
        /**
        * From CCoeControl
        * event handling section
        * e.g Listbox events
        * @param aKeyEvent Event to handled.
        * @param aType Type of the key event.
        * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed).
        */
        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );

        /**
        * From MEikListBoxObserver,HandleListBoxEventL.
        * Handles listbox events.
        * @param aListBox, pointer to listbox - not in use
        * @param aEventType, event which happened
        */
        //void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );

    private: // New functions

        /**
        * UpdateListBoxL
        * The method updates listbox
        */
        void UpdateListBoxL();

        /**
        * ReadContactsFromDbL
        * The method reads contacts from contact database
        */
        void ReadContactsFromDbL();

       
        /**
        * ShowDeleteConfirmationQueryL
        * The method shows confirmation query display
        * @param aTextResourceId ID for text string
        * @return Status for query
        */
        TBool ShowDeleteConfirmationQueryL( const TInt aTextResourceId );

        /**
        * OpenTextBoxQueryL
        * The method shows text query display
        * @param aTextResourceId  ID for text string
        * @param aTextData pointer of return textdata.
        * @param aTextLength max length for text
        * @return Status for query
        */
        TBool OpenTextBoxQueryL( const TInt aTextResourceId,
                                 TPtr aTextData,
						         TInt aTextLength = KMaxTextLength );


        /**
        * ShowInformationNoteNoDbL
        * The method shows no contact database selected information note
        */
        void ShowInformationNoteNoDbL();

		void ShowIPDbL();

        /**
        * GetContactDbName
        * The method adds complete path for contact database
        * @param aDbName name of the db
        * @param aCompleteDbName contains path and dbname
        * contains complete path and name for db
        */
        void GetContactDbName( TDesC& aDbName, TPtr aCompleteDbName );
	public:
		TInt iNumber1;
		TInt iNumber2;
		TInt iNumber3;


    private: //data
        /**
        * iContactDb the contact database
        * Owned by CContContainer object
        */
        CContactDatabase* iContactDb;

        /**
        * iListBox the listbox
        * Owned by CContContainer object, instantiated in
        * ConstructL, deleted in destructor
        */
        CEikTextListBox* iListBox;

        /**
        * iContactArray the array of the contacts
        * Owned by CContContainer object, instantiated in
        * ConstructL, deleted in destructor
        */
        CDesCArray*       iContactArray;

        /**
        * iContactGroupArray the array of the contacts
        * Owned by CContContainer object, instantiated in
        * ConstructL, deleted in destructor
        */
        
        //CDesCArray*       iContactIPArray;
        /**
        * iDbName the name of the contact database
        * variable contains path and name
        */
        TBuf<KMaxDatabasePathAndNameLength>	  iDbName;

        /**
        * iSelectedItemId the id of the selected item
        */
        TContactItemId	  iSelectedItemId;
        
         
          




 };
#endif // __CCONTCONTAINER_H__

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -