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

📄 clocationexamplecontainer.h

📁 Symbian Demo, why do you want to get 20 bytes.
💻 H
字号:
/*
* ============================================================================
*  Name     : clocationexamplecontainer.h
*  Part of  : Location Example
*  Created  : 21.05.2007 by Forum Nokia
*  Description:
*  Version  : 1.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

#ifndef LBSREFERENCECONTAINER_H
#define LBSREFERENCECONTAINER_H

// INCLUDES
#include <aknview.h>
#include <akndef.h>

#include "clocationexamplepositionlistener.h"
#include "clocationexampleengine.h"
#include "clocationexampleview.h"

// FORWARD DECLARATIONS
class CAknDoubleStyleListBox;
class CLocationExamplePositionRequestor;
class CAknsBasicBackgroundControlContext;

// CONSTANTS



// maximum length a value string may have
const TInt KValueMaxLength = 30;

// CLASS DECLARATION

/**
*  CLocationExampleContainer container control class.
*
*/
class CLocationExampleContainer : public CCoeControl, 
                               public MPositionObserver
    {
    public: // Constructors and destructor

        /**
        * Constructor
        */
        CLocationExampleContainer(CLocationExampleView* aParent);

        /**
        * Symbian default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL(const TRect& aRect);

        /**
        * Destructor.
        */
        ~CLocationExampleContainer();
                
    private:

        TTypeUid::Ptr MopSupplyObject(TTypeUid aId);

        void AddItemInListL(const TDesC& aLabel, const TDesC& aValue);

        /**
        * Changes latitude or longitude represented as degrees to 
        * a string of a form +DDD'MM''SS.SSSS
        * @param aDegrees Degrees to trasform
        * @param aDegreesString Degrees string to be returned
        */
        void GetDegreesString(
            const TReal64& aDegrees,TBuf<KDegreeLength>& aDegreesString) const;

        /**
        * Processes position info to string representation.
        * @param aPositionInfo Position information to be processed
        */
        void ProcessPositionInfoL( const TPositionInfo& aPositionInfo );

        void ShowContextSensiveMenuL();
        void ShowFriendPositionL();
        void ShowDistanceToFriendPositionL(TPositionInfo* aYourPos);


    public:
        // From MPositionListener
        void PositionUpdatedL(TPositionInfoBase& aPosInfo);   
        void FriendPositionUpdatedL(const TDesC& aInfo, const TCoordinate& aCoordinate);
        void ErrorL(const TDesC& aErrorString);
        void MessageL(const TDesC& aMessage);
        
        // From CCoeControl
        virtual TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
		void HandleResourceChange(TInt aType);
        void ResetListBoxL();

    private:
        // From CoeControl      
        void SizeChanged();
        TInt CountComponentControls() const;
        CCoeControl* ComponentControl(TInt aIndex) const;
        void Draw(const TRect& aRect) const;

		
    private: //data

        // View
        CLocationExampleView*                                iParent;

        // list box control
        CAknDoubleStyleListBox*                         iListBox;

        // listbox item array, not owned        
        CDesCArray*                                     iItemArray;

        // Buffer dynamicly filling in a list item
        TBuf<KPositionMaxModuleName + KValueMaxLength>  iListItemBuffer;
        
        CAknsBasicBackgroundControlContext*             iBgContext;            


        HBufC*                                          iTextLat;
        HBufC*                                          iTextLong;
        HBufC*                                          iTextFriendLat;
        HBufC*                                          iTextFriendLong;
        HBufC*                                          iTextFriendDist;

        TBool                                           iShowFriendPosition;
        TBuf<KAddressLength>                            iFriendPhone;
        TCoordinate                                     iFriendCoordinate;
        
    };

#endif //LBSREFERENCECONTAINER_H

// End of File

⌨️ 快捷键说明

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