/*************************************************************************** Copyright (c) Microsoft Corporation, All rights reserved. This code sample is provided "AS IS" without warranty of any kind, it is not recommended for use in a production environment. ***************************************************************************/ #ifndef codewinmgr_h #define codewinmgr_h class LanguageService; class Preferences; /*--------------------------------------------------------- CodeWindowManager ---------------------------------------------------------*/ class CodeWindowManager : public IVsCodeWindowManager, public IVsDropdownBarClient { private: ULONG m_refCount; IVsCodeWindow* m_codeWindow; LanguageService* m_lservice; Preferences* m_preferences; ObjectList m_viewFilters; IVsDropdownBar* m_dropdownBar; IVsObjectList* m_objectBrowserList; // We cache the entries in the dropdown bar, because the caller of // GetEntryText() doesn't free the WCHAR* [out] parameter that we // return to it, so we have to remember these strings and free them later. WCHAR** m_dropdownBarCache; // size_is(m_dropdownBarEntries) ULONG m_dropdownBarEntries; public: CodeWindowManager( in LanguageService* lservice, in Preferences* preferences, in IVsCodeWindow* codeWindow ); ~CodeWindowManager(); STDMETHODIMP UpdateDropdowns( in IBabelProject *project, in VSITEMID itemid ); //IUnknown STDMETHODIMP QueryInterface( in REFIID iid, out void** obj ); STDMETHODIMP_(ULONG) AddRef(); STDMETHODIMP_(ULONG) Release(); //IVsCodeWindowManager STDMETHODIMP AddAdornments(); STDMETHODIMP RemoveAdornments(); STDMETHODIMP OnNewView( in IVsTextView* textView ); //IVsDropdownBarClient STDMETHODIMP SetDropdownBar( /* [in] */ IVsDropdownBar *pDropdownBar); STDMETHODIMP GetComboAttributes( /* [in] */ long iCombo, /* [out] */ ULONG *pcEntries, /* [out] */ ULONG *puEntryType, /* [out] */ HANDLE *phImageList); STDMETHODIMP GetEntryText( /* [in] */ long iCombo, /* [in] */ long iIndex, /* [out] */ WCHAR **ppszText); STDMETHODIMP GetEntryAttributes( /* [in] */ long iCombo, /* [in] */ long iIndex, /* [out] */ ULONG *pAttr); STDMETHODIMP GetEntryImage( /* [in] */ long iCombo, /* [in] */ long iIndex, /* [out] */ long *piImageIndex); STDMETHODIMP OnItemSelected( /* [in] */ long iCombo, /* [in] */ long iIndex); STDMETHODIMP OnItemChosen( /* [in] */ long iCombo, /* [in] */ long iIndex); STDMETHODIMP OnComboGetFocus( /* [in] */ long iCombo); STDMETHODIMP GetComboTipText( /* [in] */ long iCombo, /* [out] */ BSTR *pbstrText); // Used by ViewFilter STDMETHODIMP CodeWindowManager::JumpToSpan( in long sline, in long scol, in long eline, in long ecol ); protected: STDMETHODIMP_(void) FlushDropdownBarCache(); }; #endif