// The client // has to call XComponent::dispose. The thread that calls initialize // must also execute the destruction of the instance. This is because // initialize calls OleInitialize and the destructor calls OleUninitialize. // If the service calls OleInitialize then it also calls OleUnitialize when // it is destroyed. Therefore no second instance may exist which was // created in the same thread and still needs OLE. class DropTarget : public cppu::BaseMutex, public WeakComponentImplHelper<XInitialization, XDropTarget, XServiceInfo>
{ private: friendunsigned __stdcall DndTargetOleSTAFunc(void* pParams); // The native window which acts as drop target. // It is set in initialize. In case RegisterDragDrop fails it is set // to NULL
HWND m_hWnd; // set by initialize // Holds the thread id of the thread which created the window that is the // drop target. Only used when DropTarget::initialize is called from an MTA // thread
DWORD m_threadIdWindow; // This is the thread id of the OLE thread that is created in DropTarget::initialize // when the calling thread is an MTA unsigned m_threadIdTarget; // The handle of the thread that is created in DropTarget::initialize // when the calling thread is an MTA
HANDLE m_hOleThread; // The thread id of the thread which called initialize. When the service dies // than m_oleThreadId is used to determine if the service successfully called // OleInitialize. If so then OleUninitialize has to be called.
DWORD m_oleThreadId; // An Instance of IDropTargetImpl which receives calls from the system's drag // and drop implementation. It delegate the calls to name alike functions in // this class.
IDropTarget* m_pDropTarget;
Reference<XComponentContext> m_xContext; // If m_bActive == sal_True then events are fired to XDropTargetListener s, // none otherwise. The default value is sal_True. bool m_bActive;
sal_Int8 m_nDefaultActions;
// This value is set when a XDropTargetListener calls accept or reject on // the XDropTargetDropContext or XDropTargetDragContext. // The values are from the DNDConstants group.
sal_Int8 m_nCurrentDropAction; // This value is manipulated by the XDropTargetListener
sal_Int8 m_nLastDropAction;
Reference<XTransferable> m_currentData; // The current action is used to determine if the USER // action has changed (dropActionChanged) // sal_Int8 m_userAction; // Set by listeners when they call XDropTargetDropContext::dropComplete bool m_bDropComplete;
Reference<XDropTargetDragContext> m_currentDragContext;
Reference<XDropTargetDropContext> m_currentDropContext;
// Overrides WeakComponentImplHelper::disposing which is called by // WeakComponentImplHelper::dispose // Must be called. virtualvoid SAL_CALL disposing() override; // XInitialization virtualvoid SAL_CALL initialize(const Sequence<Any>& aArguments) override;
protected: // Gets the current action dependent on the pressed modifiers, the effects // supported by the drop source (IDropSource) and the default actions of the // drop target (XDropTarget, this class)) inline sal_Int8 getFilteredActions(DWORD grfKeyState, DWORD sourceActions); // Only filters with the default actions inline sal_Int8 getFilteredActions(DWORD grfKeyState);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.