Qt 4.8
Public Functions | Public Variables | Properties | Friends | List of all members
QAxClientSite Class Reference
Inheritance diagram for QAxClientSite:

Public Functions

bool activateObject (bool initialized, const QByteArray &data)
 
unsigned long WINAPI AddRef ()
 
STDMETHOD() CanInPlaceActivate ()
 
STDMETHOD() ContextSensitiveHelp (BOOL fEnterMode)
 
void deactivate ()
 
STDMETHOD() DeactivateAndUndo ()
 
STDMETHOD() DiscardUndoState ()
 
HRESULT doVerb (LONG index)
 
void emitAmbientPropertyChange (DISPID dispid)
 
STDMETHOD() GetContainer (LPOLECONTAINER FAR *ppContainer)
 
STDMETHOD() GetExtendedControl (IDispatch **ppDisp)
 
HRESULT __stdcall GetIDsOfNames (const _GUID &, wchar_t **, unsigned int, unsigned long, long *)
 
STDMETHOD() GetMoniker (DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
 
HRESULT __stdcall GetTypeInfo (UINT, LCID, ITypeInfo **)
 
HRESULT __stdcall GetTypeInfoCount (unsigned int *)
 
STDMETHOD() GetWindow (HWND *phwnd)
 
STDMETHOD() GetWindowContext (IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
 
IOleInPlaceActiveObject * inPlaceObject () const
 
HRESULT __stdcall Invoke (DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
STDMETHOD() LockInPlaceActive (BOOL fLock)
 
QSize minimumSizeHint () const
 
STDMETHOD() OnControlInfoChanged ()
 
STDMETHOD() OnFocus (BOOL fGotFocus)
 
STDMETHOD() OnInPlaceActivate ()
 
STDMETHOD() OnInPlaceDeactivate ()
 
STDMETHOD() OnPosRectChange (LPCRECT lprcPosRect)
 
STDMETHOD() OnShowWindow (BOOL fShow)
 
STDMETHOD() OnUIActivate ()
 
STDMETHOD() OnUIDeactivate (BOOL fUndoable)
 
 QAxClientSite (QAxWidget *c)
 
int qt_metacall (QMetaObject::Call, int isignal, void **argv)
 
STDMETHOD() QueryInterface (REFIID iid, void **iface)
 
unsigned long WINAPI Release ()
 
void releaseAll ()
 
STDMETHOD() RequestNewObjectLayout ()
 
void reset (QWidget *p)
 
void resize (QSize sz)
 
STDMETHOD() SaveObject ()
 
STDMETHOD() Scroll (SIZE scrollExtant)
 
STDMETHOD() ShowObject ()
 
STDMETHOD() ShowPropertyFrame ()
 
QSize sizeHint () const
 
 STDMETHOD (InsertMenus(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths))
 
 STDMETHOD (SetMenu(HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject))
 
 STDMETHOD (RemoveMenus(HMENU hmenuShared))
 
 STDMETHOD (SetStatusText(LPCOLESTR pszStatusText))
 
 STDMETHOD (EnableModeless(BOOL fEnable))
 
 STDMETHOD (TranslateAccelerator(LPMSG lpMsg, WORD grfModifiers))
 
 STDMETHOD (GetBorder(LPRECT lprectBorder))
 
 STDMETHOD (RequestBorderSpace(LPCBORDERWIDTHS pborderwidths))
 
 STDMETHOD (SetBorderSpace(LPCBORDERWIDTHS pborderwidths))
 
 STDMETHOD (SetActiveObject(IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName))
 
 STDMETHOD (ActivateMe(IOleDocumentView *pViewToActivate))
 
 STDMETHOD_ (void, OnDataChange)(FORMATETC *
 
STGMEDIUMSTDMETHOD_ (void, OnViewChange)(DWORD
 
 STDMETHOD_ (void, OnRename)(IMoniker *)
 
 STDMETHOD_ (void, OnSave)()
 
 STDMETHOD_ (void, OnClose)()
 
STDMETHOD() TransformCoords (POINTL *pPtlHimetric, POINTF *pPtfContainer, DWORD dwFlags)
 
STDMETHOD() TranslateAccelerator (LPMSG lpMsg, DWORD grfModifiers)
 
bool translateKeyEvent (int message, int keycode) const
 
void windowActivationChange ()
 
virtual ~QAxClientSite ()
 

Public Variables

bool eventTranslated: 1
 
STGMEDIUM LONG
 

Properties

QAxAggregatedaggregatedObject
 
bool canHostDocument: 1
 
CONTROLINFO control_info
 
QAxHostWidgethost
 
bool inPlaceModelessEnabled:1
 
bool inPlaceObjectWindowless:1
 
DWORD m_dwOleObject
 
IOleDocumentView * m_spActiveView
 
IOleInPlaceActiveObject * m_spInPlaceActiveObject
 
IOleInPlaceObjectWindowless * m_spInPlaceObject
 
IOleControl * m_spOleControl
 
IOleObject * m_spOleObject
 
LONG ref
 
QSize sizehint
 
QAxWidgetwidget
 

Friends

class QAxHostWidget
 

Detailed Description

Definition at line 152 of file qaxwidget.cpp.

Constructors and Destructors

◆ QAxClientSite()

QAxClientSite::QAxClientSite ( QAxWidget c)

Definition at line 530 of file qaxwidget.cpp.

531 : eventTranslated(true), ref(1), widget(c), host(0)
532 {
534  if (aggregatedObject) {
535  aggregatedObject->controlling_unknown = (IUnknown*)(IDispatch*)this;
537  }
538 
539  m_spOleObject = 0;
540  m_spOleControl = 0;
541  m_spInPlaceObject = 0;
543  m_spActiveView = 0;
544 
545  inPlaceObjectWindowless = false;
546  inPlaceModelessEnabled = true;
547  canHostDocument = false;
548 
549  m_dwOleObject = 0;
550 #if !defined(Q_WS_WINCE)
551  m_menuOwner = 0;
552  menuBar = 0;
553 #endif
554  memset(&control_info, 0, sizeof(control_info));
555 }
IOleInPlaceObjectWindowless * m_spInPlaceObject
Definition: qaxwidget.cpp:394
DWORD m_dwOleObject
Definition: qaxwidget.cpp:404
unsigned char c[8]
Definition: qnumeric_p.h:62
CONTROLINFO control_info
Definition: qaxwidget.cpp:408
QAxHostWidget * host
Definition: qaxwidget.cpp:413
QObject * the_object
Definition: qaxaggregated.h:79
IOleControl * m_spOleControl
Definition: qaxwidget.cpp:393
IOleDocumentView * m_spActiveView
Definition: qaxwidget.cpp:396
bool inPlaceObjectWindowless
Definition: qaxwidget.cpp:400
bool eventTranslated
Definition: qaxwidget.cpp:377
IOleObject * m_spOleObject
Definition: qaxwidget.cpp:392
QAxAggregated * aggregatedObject
Definition: qaxwidget.cpp:398
IUnknown * controlling_unknown
Definition: qaxaggregated.h:78
QAxWidget * widget
Definition: qaxwidget.cpp:412
bool canHostDocument
Definition: qaxwidget.cpp:402
bool inPlaceModelessEnabled
Definition: qaxwidget.cpp:401
virtual QAxAggregated * createAggregate()
Reimplement this function when you want to implement additional COM interfaces for the client site of...
Definition: qaxwidget.cpp:2017
IOleInPlaceActiveObject * m_spInPlaceActiveObject
Definition: qaxwidget.cpp:395

◆ ~QAxClientSite()

QAxClientSite::~QAxClientSite ( )
virtual

Definition at line 737 of file qaxwidget.cpp.

738 {
739  if (host) {
740  host->axhost = 0;
741  }
742 
743  if (aggregatedObject)
745  delete aggregatedObject;
746  delete host;
747 }
QAxHostWidget * host
Definition: qaxwidget.cpp:413
QObject * the_object
Definition: qaxaggregated.h:79
QAxClientSite * axhost
Definition: qaxwidget.cpp:144
QAxAggregated * aggregatedObject
Definition: qaxwidget.cpp:398

Functions

◆ activateObject()

bool QAxClientSite::activateObject ( bool  initialized,
const QByteArray data 
)

Definition at line 557 of file qaxwidget.cpp.

Referenced by QAxWidget::createHostWindow().

558 {
559  if (!host)
560  host = new QAxHostWidget(widget, this);
561 
562  bool showHost = false;
563  if (!m_spOleObject)
564  widget->queryInterface(IID_IOleObject, (void**)&m_spOleObject);
565  if (m_spOleObject) {
566  DWORD dwMiscStatus = 0;
567  m_spOleObject->GetMiscStatus(DVASPECT_CONTENT, &dwMiscStatus);
568 
569 #if !defined(Q_OS_WINCE)
570  IOleDocument *document = 0;
571  m_spOleObject->QueryInterface(IID_IOleDocument, (void**)&document);
572  if (document) {
573  IPersistStorage *persistStorage = 0;
574  document->QueryInterface(IID_IPersistStorage, (void**)&persistStorage);
575  if (persistStorage) {
576  // try to activate as document server
577  IStorage *storage = 0;
578  ILockBytes * bytes = 0;
579  ::CreateILockBytesOnHGlobal(0, TRUE, &bytes);
580  ::StgCreateDocfileOnILockBytes(bytes, STGM_SHARE_EXCLUSIVE|STGM_CREATE|STGM_READWRITE, 0, &storage);
581 
582  persistStorage->InitNew(storage);
583  persistStorage->Release();
584  canHostDocument = true;
585  storage->Release();
586  bytes->Release();
587 
588  m_spOleObject->SetClientSite(this);
589  OleRun(m_spOleObject);
590  }
591  document->Release();
592  }
593 #endif
594 
595  if (!canHostDocument) {
596  // activate as control
597  if(dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST)
598  m_spOleObject->SetClientSite(this);
599 
600  if (!initialized) {
601  IPersistStreamInit *spPSI = 0;
602  m_spOleObject->QueryInterface(IID_IPersistStreamInit, (void**)&spPSI);
603  if (spPSI) {
604  if (data.length()) {
605  IStream *pStream = 0;
606  HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, data.length());
607  if (hGlobal) {
608  BYTE *pStByte = (BYTE *)GlobalLock(hGlobal);
609  if (pStByte)
610  memcpy(pStByte, data.data(), data.length());
611  GlobalUnlock(hGlobal);
612  if (SUCCEEDED(CreateStreamOnHGlobal(hGlobal, TRUE, &pStream))) {
613  spPSI->Load(pStream);
614  pStream->Release();
615  }
616  GlobalFree(hGlobal);
617  }
618  } else {
619  spPSI->InitNew();
620  }
621  spPSI->Release();
622  } else if (data.length()) { //try initializing using a IPersistStorage
623  IPersistStorage *spPS = 0;
624  m_spOleObject->QueryInterface( IID_IPersistStorage, (void**)&spPS );
625  if (spPS) {
626  HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, data.length());
627  if (hGlobal) {
628 #if !defined(Q_OS_WINCE)
629  BYTE* pbData = (BYTE*)GlobalLock(hGlobal);
630  if (pbData)
631  memcpy(pbData, data.data(), data.length());
632  GlobalUnlock(hGlobal);
633  // open an IStorage on the data and pass it to Load
634  LPLOCKBYTES pLockBytes = 0;
635  if (SUCCEEDED(CreateILockBytesOnHGlobal(hGlobal, TRUE, &pLockBytes))) {
636  LPSTORAGE pStorage = 0;
637  if (SUCCEEDED(StgOpenStorageOnILockBytes(pLockBytes, 0,
638  STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &pStorage))) {
639  spPS->Load(pStorage);
640  pStorage->Release();
641  }
642  pLockBytes->Release();
643  }
644  GlobalFree(hGlobal);
645 #endif
646  }
647  spPS->Release();
648  }
649  }
650  }
651 
652  if(!(dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST))
653  m_spOleObject->SetClientSite(this);
654  }
655 
656  IViewObject *spViewObject = 0;
657  m_spOleObject->QueryInterface(IID_IViewObject, (void**) &spViewObject);
658 
659  m_spOleObject->Advise(this, &m_dwOleObject);
660  IAdviseSink *spAdviseSink = 0;
661  QueryInterface(IID_IAdviseSink, (void**)&spAdviseSink);
662  if (spAdviseSink && spViewObject) {
663  if (spViewObject)
664  spViewObject->SetAdvise(DVASPECT_CONTENT, 0, spAdviseSink);
665  }
666  if (spAdviseSink)
667  spAdviseSink->Release();
668  if (spViewObject)
669  spViewObject->Release();
670 
671  m_spOleObject->SetHostNames(OLESTR("AXWIN"), 0);
672 
673  if (!(dwMiscStatus & OLEMISC_INVISIBLEATRUNTIME)) {
674  SIZEL hmSize;
675  hmSize.cx = MAP_PIX_TO_LOGHIM(250, widget->logicalDpiX());
676  hmSize.cy = MAP_PIX_TO_LOGHIM(250, widget->logicalDpiY());
677 
678  m_spOleObject->SetExtent(DVASPECT_CONTENT, &hmSize);
679  m_spOleObject->GetExtent(DVASPECT_CONTENT, &hmSize);
680 
683  showHost = true;
684  } else {
685  sizehint = QSize(0, 0);
686  host->hide();
687  }
688  if (!(dwMiscStatus & OLEMISC_NOUIACTIVATE)) {
690  } else {
692  }
693 
694  RECT rcPos = { host->x(), host->y(), host->x()+sizehint.width(), host->y()+sizehint.height() };
695 
696  m_spOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, 0, (IOleClientSite*)this, 0, host->winId(), &rcPos);
697 
698  if (!m_spOleControl)
699  m_spOleObject->QueryInterface(IID_IOleControl, (void**)&m_spOleControl);
700  if (m_spOleControl) {
701  m_spOleControl->OnAmbientPropertyChange(DISPID_AMBIENT_BACKCOLOR);
702  m_spOleControl->OnAmbientPropertyChange(DISPID_AMBIENT_FORECOLOR);
703  m_spOleControl->OnAmbientPropertyChange(DISPID_AMBIENT_FONT);
704  m_spOleControl->OnAmbientPropertyChange(DISPID_AMBIENT_USERMODE);
705 
706  control_info.cb = sizeof(control_info);
707  m_spOleControl->GetControlInfo(&control_info);
708  }
709 
710  BSTR userType;
711  HRESULT result = m_spOleObject->GetUserType(USERCLASSTYPE_SHORT, &userType);
712  if (result == S_OK) {
714  CoTaskMemFree(userType);
715  }
716  } else {
717  IObjectWithSite *spSite = 0;
718  widget->queryInterface(IID_IObjectWithSite, (void**)&spSite);
719  if (spSite) {
720  spSite->SetSite((IUnknown*)(IDispatch*)this);
721  spSite->Release();
722  }
723  }
724 
725  host->resize(widget->size());
726  if (showHost)
727  host->show();
728 
729  if (host->focusPolicy() != Qt::NoFocus) {
732  }
733 
734  return true;
735 }
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
Definition: qstring.cpp:1019
DWORD m_dwOleObject
Definition: qaxwidget.cpp:404
int y() const
QSize size() const
#define BYTE
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
int logicalDpiY() const
Definition: qpaintdevice.h:96
friend class QAxHostWidget
Definition: qaxwidget.cpp:164
#define MAP_LOGHIM_TO_PIX(x, ppli)
Definition: qaxtypes.h:73
CONTROLINFO control_info
Definition: qaxwidget.cpp:408
QAxHostWidget * host
Definition: qaxwidget.cpp:413
void setHeight(int h)
Sets the height to the given height.
Definition: qsize.h:135
Qt::FocusPolicy focusPolicy() const
void setWidth(int w)
Sets the width to the given width.
Definition: qsize.h:132
IOleControl * m_spOleControl
Definition: qaxwidget.cpp:393
int logicalDpiX() const
Definition: qpaintdevice.h:95
void setWindowTitle(const QString &)
Definition: qwidget.cpp:6312
int width() const
Returns the width.
Definition: qsize.h:126
#define MAP_PIX_TO_LOGHIM(x, ppli)
Definition: qaxtypes.h:72
void show()
Shows the widget and its child widgets.
void hide()
Hides the widget.
Definition: qwidget.h:501
#define TRUE
Synonym for true.
Definition: qglobal.h:1018
int length() const
Same as size().
Definition: qbytearray.h:356
void setFocusProxy(QWidget *)
Sets the widget's focus proxy to widget w.
Definition: qwidget.cpp:6537
long HRESULT
IOleObject * m_spOleObject
Definition: qaxwidget.cpp:392
int x() const
void resize(int w, int h)
This corresponds to resize(QSize(w, h)).
Definition: qwidget.h:1014
QAxWidget * widget
Definition: qaxwidget.cpp:412
int height() const
Returns the height.
Definition: qsize.h:129
STDMETHOD() QueryInterface(REFIID iid, void **iface)
Definition: qaxwidget.cpp:789
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
bool canHostDocument
Definition: qaxwidget.cpp:402
long queryInterface(const QUuid &, void **) const
Requests the interface uuid from the COM object and sets the value of iface to the provided interface...
Definition: qaxbase.cpp:1479
#define GMEM_MOVEABLE
void setFocusPolicy(Qt::FocusPolicy policy)
Definition: qwidget.cpp:7631

◆ AddRef()

unsigned long WINAPI QAxClientSite::AddRef ( )

Definition at line 775 of file qaxwidget.cpp.

Referenced by QueryInterface().

776 {
777  return InterlockedIncrement(&ref);
778 }

◆ CanInPlaceActivate()

HRESULT WINAPI QAxClientSite::CanInPlaceActivate ( )

Definition at line 1053 of file qaxwidget.cpp.

1054 {
1056  return S_OK;
1057 }
#define AX_DEBUG(x)
Definition: qaxwidget.cpp:73
STDMETHOD() CanInPlaceActivate()
Definition: qaxwidget.cpp:1053

◆ ContextSensitiveHelp()

HRESULT WINAPI QAxClientSite::ContextSensitiveHelp ( BOOL  fEnterMode)

Definition at line 1042 of file qaxwidget.cpp.

1043 {
1044  if (fEnterMode)
1046  else
1048 
1049  return S_OK;
1050 }
static void enterWhatsThisMode()
This function switches the user interface into "What's This?" mode.
Definition: qwhatsthis.cpp:633
static void leaveWhatsThisMode()
If the user interface is in "What's This?" mode, this function switches back to normal mode; otherwis...
Definition: qwhatsthis.cpp:662

◆ deactivate()

void QAxClientSite::deactivate ( )

Definition at line 767 of file qaxwidget.cpp.

Referenced by QAxWidget::clear().

768 {
769  if (m_spInPlaceObject) m_spInPlaceObject->InPlaceDeactivate();
770  // if this assertion fails the control didn't call OnInPlaceDeactivate
772 }
IOleInPlaceObjectWindowless * m_spInPlaceObject
Definition: qaxwidget.cpp:394
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

◆ DeactivateAndUndo()

HRESULT WINAPI QAxClientSite::DeactivateAndUndo ( )

Definition at line 1140 of file qaxwidget.cpp.

1141 {
1142  if (m_spInPlaceObject)
1143  m_spInPlaceObject->UIDeactivate();
1144 
1145  return S_OK;
1146 }
IOleInPlaceObjectWindowless * m_spInPlaceObject
Definition: qaxwidget.cpp:394

◆ DiscardUndoState()

HRESULT WINAPI QAxClientSite::DiscardUndoState ( )

Definition at line 1135 of file qaxwidget.cpp.

1136 {
1137  return S_OK;
1138 }

◆ doVerb()

HRESULT QAxClientSite::doVerb ( LONG  index)
inline

Definition at line 186 of file qaxwidget.cpp.

Referenced by QAxWidget::doVerb().

187  {
188  if (!m_spOleObject)
189  return E_NOTIMPL;
190  if (!host)
191  return OLE_E_NOT_INPLACEACTIVE;
192 
193  RECT rcPos = { host->x(), host->y(), host->x()+host->width(), host->y()+host->height() };
194  return m_spOleObject->DoVerb(index, 0, this, 0, host->winId(), &rcPos);
195  }
int y() const
QAxHostWidget * host
Definition: qaxwidget.cpp:413
int height() const
int width() const
IOleObject * m_spOleObject
Definition: qaxwidget.cpp:392
int x() const
quint16 index
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557

◆ emitAmbientPropertyChange()

void QAxClientSite::emitAmbientPropertyChange ( DISPID  dispid)

Definition at line 904 of file qaxwidget.cpp.

Referenced by QAxWidget::changeEvent().

905 {
906  if (m_spOleControl)
907  m_spOleControl->OnAmbientPropertyChange(dispid);
908 }
IOleControl * m_spOleControl
Definition: qaxwidget.cpp:393

◆ GetContainer()

HRESULT WINAPI QAxClientSite::GetContainer ( LPOLECONTAINER FAR *  ppContainer)

Definition at line 925 of file qaxwidget.cpp.

926 {
927  if (!ppContainer)
928  return E_POINTER;
929 
930  *ppContainer = 0;
931  return E_NOINTERFACE;
932 }

◆ GetExtendedControl()

HRESULT WINAPI QAxClientSite::GetExtendedControl ( IDispatch **  ppDisp)

Definition at line 964 of file qaxwidget.cpp.

965 {
966  if (!ppDisp)
967  return E_POINTER;
968 
969  *ppDisp = 0;
970  return E_NOTIMPL;
971 }

◆ GetIDsOfNames()

HRESULT __stdcall QAxClientSite::GetIDsOfNames ( const _GUID ,
wchar_t **  ,
unsigned  int,
unsigned  long,
long *   
)
inline

Definition at line 205 of file qaxwidget.cpp.

205 { return E_NOTIMPL; }

◆ GetMoniker()

HRESULT WINAPI QAxClientSite::GetMoniker ( DWORD  dwAssign,
DWORD  dwWhichMoniker,
IMoniker **  ppmk 
)

Definition at line 916 of file qaxwidget.cpp.

917 {
918  if (!ppmk)
919  return E_POINTER;
920 
921  *ppmk = 0;
922  return E_NOTIMPL;
923 }

◆ GetTypeInfo()

HRESULT __stdcall QAxClientSite::GetTypeInfo ( UINT  ,
LCID  ,
ITypeInfo **   
)
inline

Definition at line 204 of file qaxwidget.cpp.

204 { return E_NOTIMPL; }

◆ GetTypeInfoCount()

HRESULT __stdcall QAxClientSite::GetTypeInfoCount ( unsigned int *  )
inline

Definition at line 203 of file qaxwidget.cpp.

203 { return E_NOTIMPL; }

◆ GetWindow()

HRESULT WINAPI QAxClientSite::GetWindow ( HWND *  phwnd)

Definition at line 1033 of file qaxwidget.cpp.

1034 {
1035  if (!phwnd)
1036  return E_POINTER;
1037 
1038  *phwnd = host->winId();
1039  return S_OK;
1040 }
QAxHostWidget * host
Definition: qaxwidget.cpp:413
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557

◆ GetWindowContext()

HRESULT WINAPI QAxClientSite::GetWindowContext ( IOleInPlaceFrame **  ppFrame,
IOleInPlaceUIWindow **  ppDoc,
LPRECT  lprcPosRect,
LPRECT  lprcClipRect,
LPOLEINPLACEFRAMEINFO  lpFrameInfo 
)

Definition at line 1086 of file qaxwidget.cpp.

1087 {
1088  if (!ppFrame || !ppDoc || !lprcPosRect || !lprcClipRect || !lpFrameInfo)
1089  return E_POINTER;
1090 
1091  QueryInterface(IID_IOleInPlaceFrame, (void**)ppFrame);
1092  QueryInterface(IID_IOleInPlaceUIWindow, (void**)ppDoc);
1093 
1094  ::GetClientRect(host->winId(), lprcPosRect);
1095  ::GetClientRect(host->winId(), lprcClipRect);
1096 
1097  lpFrameInfo->cb = sizeof(OLEINPLACEFRAMEINFO);
1098  lpFrameInfo->fMDIApp = false;
1099  lpFrameInfo->haccel = 0;
1100  lpFrameInfo->cAccelEntries = 0;
1101  lpFrameInfo->hwndFrame = widget ? widget->window()->winId() : 0;
1102 
1103  return S_OK;
1104 }
QAxHostWidget * host
Definition: qaxwidget.cpp:413
QAxWidget * widget
Definition: qaxwidget.cpp:412
STDMETHOD() QueryInterface(REFIID iid, void **iface)
Definition: qaxwidget.cpp:789
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557

◆ inPlaceObject()

IOleInPlaceActiveObject* QAxClientSite::inPlaceObject ( ) const
inline

Definition at line 181 of file qaxwidget.cpp.

Referenced by axc_FilterProc().

182  {
184  }
IOleInPlaceActiveObject * m_spInPlaceActiveObject
Definition: qaxwidget.cpp:395

◆ Invoke()

HRESULT WINAPI QAxClientSite::Invoke ( DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT *  puArgErr 
)

Definition at line 839 of file qaxwidget.cpp.

847 {
848  if (!pVarResult)
849  return E_POINTER;
850  if (!widget || !host)
851  return E_UNEXPECTED;
852 
853  switch(dispIdMember) {
854  case DISPID_AMBIENT_USERMODE:
855  pVarResult->vt = VT_BOOL;
856  pVarResult->boolVal = !qax_runsInDesignMode;
857  return S_OK;
858 
859  case DISPID_AMBIENT_AUTOCLIP:
860  case DISPID_AMBIENT_SUPPORTSMNEMONICS:
861  pVarResult->vt = VT_BOOL;
862  pVarResult->boolVal = true;
863  return S_OK;
864 
865  case DISPID_AMBIENT_SHOWHATCHING:
866  case DISPID_AMBIENT_SHOWGRABHANDLES:
867  case DISPID_AMBIENT_DISPLAYASDEFAULT:
868  case DISPID_AMBIENT_MESSAGEREFLECT:
869  pVarResult->vt = VT_BOOL;
870  pVarResult->boolVal = false;
871  return S_OK;
872 
873  case DISPID_AMBIENT_DISPLAYNAME:
874  pVarResult->vt = VT_BSTR;
875  pVarResult->bstrVal = QStringToBSTR(widget->windowTitle());
876  return S_OK;
877 
878  case DISPID_AMBIENT_FONT:
879  QVariantToVARIANT(widget->font(), *pVarResult);
880  return S_OK;
881 
882  case DISPID_AMBIENT_BACKCOLOR:
883  pVarResult->vt = VT_UI4;
884  pVarResult->lVal = QColorToOLEColor(widget->palette().color(widget->backgroundRole()));
885  return S_OK;
886 
887  case DISPID_AMBIENT_FORECOLOR:
888  pVarResult->vt = VT_UI4;
889  pVarResult->lVal = QColorToOLEColor(widget->palette().color(widget->foregroundRole()));
890  return S_OK;
891 
892  case DISPID_AMBIENT_UIDEAD:
893  pVarResult->vt = VT_BOOL;
894  pVarResult->boolVal = !widget->isEnabled();
895  return S_OK;
896 
897  default:
898  break;
899  }
900 
901  return DISP_E_MEMBERNOTFOUND;
902 }
bool qax_runsInDesignMode
Definition: qaxwidget.cpp:836
QPalette::ColorRole backgroundRole() const
Returns the background role of the widget.
Definition: qwidget.cpp:4677
QAxHostWidget * host
Definition: qaxwidget.cpp:413
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
Definition: qpalette.h:107
QPalette::ColorRole foregroundRole() const
Returns the foreground role.
Definition: qwidget.cpp:4728
const QPalette & palette() const
bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out)
Definition: qaxtypes.cpp:246
QString windowTitle() const
static uint QColorToOLEColor(const QColor &col)
Definition: qaxtypes.h:81
bool isEnabled() const
Definition: qwidget.h:948
QAxWidget * widget
Definition: qaxwidget.cpp:412
static BSTR QStringToBSTR(const QString &str)
Definition: qaxtypes.h:76
const QFont & font() const

◆ LockInPlaceActive()

HRESULT WINAPI QAxClientSite::LockInPlaceActive ( BOOL  fLock)

Definition at line 958 of file qaxwidget.cpp.

959 {
961  return S_OK;
962 }
#define AX_DEBUG(x)
Definition: qaxwidget.cpp:73
STDMETHOD() LockInPlaceActive(BOOL fLock)
Definition: qaxwidget.cpp:958

◆ minimumSizeHint()

QSize QAxClientSite::minimumSizeHint ( ) const

Definition at line 1590 of file qaxwidget.cpp.

Referenced by QAxWidget::minimumSizeHint(), and QAxHostWidget::minimumSizeHint().

1591 {
1592  if (!m_spOleObject)
1593  return QSize();
1594 
1595  SIZE sz = { 0, 0 };
1596  m_spOleObject->SetExtent(DVASPECT_CONTENT, &sz);
1597  HRESULT res = m_spOleObject->GetExtent(DVASPECT_CONTENT, &sz);
1598  if (SUCCEEDED(res)) {
1599  return QSize(MAP_LOGHIM_TO_PIX(sz.cx, widget->logicalDpiX()),
1600  MAP_LOGHIM_TO_PIX(sz.cy, widget->logicalDpiY()));
1601  }
1602  return QSize();
1603 }
int logicalDpiY() const
Definition: qpaintdevice.h:96
#define MAP_LOGHIM_TO_PIX(x, ppli)
Definition: qaxtypes.h:73
#define SIZE(large, small, mini)
int logicalDpiX() const
Definition: qpaintdevice.h:95
long HRESULT
IOleObject * m_spOleObject
Definition: qaxwidget.cpp:392
QAxWidget * widget
Definition: qaxwidget.cpp:412
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ OnControlInfoChanged()

HRESULT WINAPI QAxClientSite::OnControlInfoChanged ( )

Definition at line 950 of file qaxwidget.cpp.

951 {
952  if (m_spOleControl)
953  m_spOleControl->GetControlInfo(&control_info);
954 
955  return S_OK;
956 }
CONTROLINFO control_info
Definition: qaxwidget.cpp:408
IOleControl * m_spOleControl
Definition: qaxwidget.cpp:393

◆ OnFocus()

HRESULT WINAPI QAxClientSite::OnFocus ( BOOL  fGotFocus)

Definition at line 1015 of file qaxwidget.cpp.

1016 {
1018  if (host) {
1019  host->hasFocus = bGotFocus;
1020  qApp->removeEventFilter(host);
1021  if (bGotFocus)
1022  qApp->installEventFilter(host);
1023  }
1024  return S_OK;
1025 }
QAxHostWidget * host
Definition: qaxwidget.cpp:413
#define AX_DEBUG(x)
Definition: qaxwidget.cpp:73
STDMETHOD() OnFocus(BOOL fGotFocus)
Definition: qaxwidget.cpp:1015
#define qApp

◆ OnInPlaceActivate()

HRESULT WINAPI QAxClientSite::OnInPlaceActivate ( )

Definition at line 1059 of file qaxwidget.cpp.

1060 {
1062 #if !defined(Q_OS_WINCE)
1063  OleLockRunning(m_spOleObject, true, false);
1064 #endif
1065  if (!m_spInPlaceObject) {
1066 /* ### disabled for now
1067  m_spOleObject->QueryInterface(IID_IOleInPlaceObjectWindowless, (void**) &m_spInPlaceObject);
1068 */
1069  if (m_spInPlaceObject) {
1070  inPlaceObjectWindowless = true;
1071  } else {
1072  inPlaceObjectWindowless = false;
1073  m_spOleObject->QueryInterface(IID_IOleInPlaceObject, (void**) &m_spInPlaceObject);
1074  }
1075  }
1076 
1077  return S_OK;
1078 }
IOleInPlaceObjectWindowless * m_spInPlaceObject
Definition: qaxwidget.cpp:394
#define AX_DEBUG(x)
Definition: qaxwidget.cpp:73
bool inPlaceObjectWindowless
Definition: qaxwidget.cpp:400
IOleObject * m_spOleObject
Definition: qaxwidget.cpp:392
STDMETHOD() OnInPlaceActivate()
Definition: qaxwidget.cpp:1059

◆ OnInPlaceDeactivate()

HRESULT WINAPI QAxClientSite::OnInPlaceDeactivate ( )

Definition at line 1121 of file qaxwidget.cpp.

1122 {
1124  if (m_spInPlaceObject)
1125  m_spInPlaceObject->Release();
1126  m_spInPlaceObject = 0;
1127  inPlaceObjectWindowless = false;
1128 #if !defined(Q_OS_WINCE)
1129  OleLockRunning(m_spOleObject, false, false);
1130 #endif
1131 
1132  return S_OK;
1133 }
IOleInPlaceObjectWindowless * m_spInPlaceObject
Definition: qaxwidget.cpp:394
#define AX_DEBUG(x)
Definition: qaxwidget.cpp:73
bool inPlaceObjectWindowless
Definition: qaxwidget.cpp:400
IOleObject * m_spOleObject
Definition: qaxwidget.cpp:392
STDMETHOD() OnInPlaceDeactivate()
Definition: qaxwidget.cpp:1121

◆ OnPosRectChange()

HRESULT WINAPI QAxClientSite::OnPosRectChange ( LPCRECT  lprcPosRect)

Definition at line 1148 of file qaxwidget.cpp.

1149 {
1151  // ###
1152  return S_OK;
1153 }
#define AX_DEBUG(x)
Definition: qaxwidget.cpp:73
STDMETHOD() OnPosRectChange(LPCRECT lprcPosRect)
Definition: qaxwidget.cpp:1148

◆ OnShowWindow()

HRESULT WINAPI QAxClientSite::OnShowWindow ( BOOL  fShow)

Definition at line 939 of file qaxwidget.cpp.

940 {
941  return S_OK;
942 }

◆ OnUIActivate()

HRESULT WINAPI QAxClientSite::OnUIActivate ( )

Definition at line 1080 of file qaxwidget.cpp.

1081 {
1083  return S_OK;
1084 }
#define AX_DEBUG(x)
Definition: qaxwidget.cpp:73
STDMETHOD() OnUIActivate()
Definition: qaxwidget.cpp:1080

◆ OnUIDeactivate()

HRESULT WINAPI QAxClientSite::OnUIDeactivate ( BOOL  fUndoable)

Definition at line 1111 of file qaxwidget.cpp.

1112 {
1114  if (host && host->hasFocus) {
1115  qApp->removeEventFilter(host);
1116  host->hasFocus = false;
1117  }
1118  return S_OK;
1119 }
QAxHostWidget * host
Definition: qaxwidget.cpp:413
#define AX_DEBUG(x)
Definition: qaxwidget.cpp:73
#define qApp
STDMETHOD() OnUIDeactivate(BOOL fUndoable)
Definition: qaxwidget.cpp:1111

◆ qt_metacall()

int QAxClientSite::qt_metacall ( QMetaObject::Call  ,
int  isignal,
void **  argv 
)

Definition at line 1386 of file qaxwidget.cpp.

Referenced by QAxHostWidget::qt_metacall().

1387 {
1388  return isignal;
1389 #else
1390 int QAxClientSite::qt_metacall(QMetaObject::Call call, int isignal, void **argv)
1391 {
1392  if (!m_spOleObject || call != QMetaObject::InvokeMetaMethod || !menuBar)
1393  return isignal;
1394 
1395  if (isignal != menuBar->metaObject()->indexOfSignal("triggered(QAction*)"))
1396  return isignal;
1397 
1398  QAction *action = *(QAction**)argv[1];
1399  // ###
1400 
1401  OleMenuItem oleItem = menuItemMap.value(action);
1402  if (oleItem.hMenu)
1403  ::PostMessage(m_menuOwner, WM_COMMAND, oleItem.id, 0);
1404  return -1;
1405 #endif
1406 }
IOleObject * m_spOleObject
Definition: qaxwidget.cpp:392
int qt_metacall(QMetaObject::Call, int isignal, void **argv)
Definition: qaxwidget.cpp:1386
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64

◆ QueryInterface()

HRESULT WINAPI QAxClientSite::QueryInterface ( REFIID  iid,
void **  iface 
)

Definition at line 789 of file qaxwidget.cpp.

Referenced by activateObject(), and GetWindowContext().

790 {
791  *iface = 0;
792 
793  if (iid == IID_IUnknown) {
794  *iface = (IUnknown*)(IDispatch*)this;
795  } else {
796  HRESULT res = S_OK;
797  if (aggregatedObject)
798  res = aggregatedObject->queryInterface(iid, iface);
799  if (*iface)
800  return res;
801  }
802 
803  if (!(*iface)) {
804  if (iid == IID_IDispatch)
805  *iface = (IDispatch*)this;
806  else if (iid == IID_IOleClientSite)
807  *iface = (IOleClientSite*)this;
808  else if (iid == IID_IOleControlSite)
809  *iface = (IOleControlSite*)this;
810  else if (iid == IID_IOleWindow)
811  *iface = (IOleWindow*)(IOleInPlaceSite*)this;
812  else if (iid == IID_IOleInPlaceSite)
813  *iface = (IOleInPlaceSite*)this;
814 #ifdef QAX_SUPPORT_WINDOWLESS
815  else if (iid == IID_IOleInPlaceSiteEx)
816  *iface = (IOleInPlaceSiteEx*)this;
817  else if (iid == IID_IOleInPlaceSiteWindowless)
818  *iface = (IOleInPlaceSiteWindowless*)this;
819 #endif
820  else if (iid == IID_IOleInPlaceFrame)
821  *iface = (IOleInPlaceFrame*)this;
822  else if (iid == IID_IOleInPlaceUIWindow)
823  *iface = (IOleInPlaceUIWindow*)this;
824  else if (iid == IID_IOleDocumentSite && canHostDocument)
825  *iface = (IOleDocumentSite*)this;
826  else if (iid == IID_IAdviseSink)
827  *iface = (IAdviseSink*)this;
828  }
829  if (!*iface)
830  return E_NOINTERFACE;
831 
832  AddRef();
833  return S_OK;
834 }
unsigned long WINAPI AddRef()
Definition: qaxwidget.cpp:775
long HRESULT
QAxAggregated * aggregatedObject
Definition: qaxwidget.cpp:398
virtual long queryInterface(const QUuid &iid, void **iface)=0
Reimplement this pure virtual function to support additional COM interfaces.
bool canHostDocument
Definition: qaxwidget.cpp:402

◆ Release()

unsigned long WINAPI QAxClientSite::Release ( )

Definition at line 780 of file qaxwidget.cpp.

Referenced by QAxWidget::clear().

781 {
782  LONG refCount = InterlockedDecrement(&ref);
783  if (!refCount)
784  delete this;
785 
786  return refCount;
787 }
STGMEDIUM LONG
Definition: qaxwidget.cpp:350

◆ releaseAll()

void QAxClientSite::releaseAll ( )

Definition at line 749 of file qaxwidget.cpp.

Referenced by QAxWidget::clear().

750 {
751  if (m_spOleObject) {
752  m_spOleObject->SetClientSite(0);
753  m_spOleObject->Unadvise(m_dwOleObject);
754  m_spOleObject->Release();
755  }
756  m_spOleObject = 0;
757  if (m_spOleControl) m_spOleControl->Release();
758  m_spOleControl = 0;
759  if (m_spInPlaceObject) m_spInPlaceObject->Release();
760  m_spInPlaceObject = 0;
763 
764  inPlaceObjectWindowless = false;
765 }
IOleInPlaceObjectWindowless * m_spInPlaceObject
Definition: qaxwidget.cpp:394
DWORD m_dwOleObject
Definition: qaxwidget.cpp:404
IOleControl * m_spOleControl
Definition: qaxwidget.cpp:393
bool inPlaceObjectWindowless
Definition: qaxwidget.cpp:400
IOleObject * m_spOleObject
Definition: qaxwidget.cpp:392
IOleInPlaceActiveObject * m_spInPlaceActiveObject
Definition: qaxwidget.cpp:395

◆ RequestNewObjectLayout()

HRESULT WINAPI QAxClientSite::RequestNewObjectLayout ( )

Definition at line 944 of file qaxwidget.cpp.

945 {
946  return E_NOTIMPL;
947 }

◆ reset()

void QAxClientSite::reset ( QWidget p)
inline

Definition at line 173 of file qaxwidget.cpp.

Referenced by QAxHostWidget::~QAxHostWidget(), and QAxWidget::~QAxWidget().

174  {
175  if (widget == p)
176  widget = 0;
177  else if (host == p)
178  host = 0;
179  }
QAxHostWidget * host
Definition: qaxwidget.cpp:413
QAxWidget * widget
Definition: qaxwidget.cpp:412

◆ resize()

void QAxClientSite::resize ( QSize  sz)
inline

Definition at line 365 of file qaxwidget.cpp.

Referenced by QAxWidget::resizeEvent().

365 { if (host) host->resize(sz); }
QAxHostWidget * host
Definition: qaxwidget.cpp:413
void resize(int w, int h)
This corresponds to resize(QSize(w, h)).
Definition: qwidget.h:1014

◆ SaveObject()

HRESULT WINAPI QAxClientSite::SaveObject ( )

Definition at line 911 of file qaxwidget.cpp.

912 {
913  return E_NOTIMPL;
914 }

◆ Scroll()

HRESULT WINAPI QAxClientSite::Scroll ( SIZE  scrollExtant)

Definition at line 1106 of file qaxwidget.cpp.

1107 {
1108  return S_FALSE;
1109 }

◆ ShowObject()

HRESULT WINAPI QAxClientSite::ShowObject ( )

Definition at line 934 of file qaxwidget.cpp.

935 {
936  return S_OK;
937 }

◆ ShowPropertyFrame()

HRESULT WINAPI QAxClientSite::ShowPropertyFrame ( )

Definition at line 1027 of file qaxwidget.cpp.

1028 {
1029  return E_NOTIMPL;
1030 }

◆ sizeHint()

QSize QAxClientSite::sizeHint ( ) const
inline

Definition at line 363 of file qaxwidget.cpp.

Referenced by QAxWidget::sizeHint(), and QAxHostWidget::sizeHint().

363 { return sizehint; }

◆ STDMETHOD() [1/11]

QAxClientSite::STDMETHOD ( InsertMenus(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)  )

◆ STDMETHOD() [2/11]

QAxClientSite::STDMETHOD ( SetMenu(HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject)  )

◆ STDMETHOD() [3/11]

QAxClientSite::STDMETHOD ( RemoveMenus(HMENU hmenuShared)  )

◆ STDMETHOD() [4/11]

QAxClientSite::STDMETHOD ( SetStatusText(LPCOLESTR pszStatusText)  )

◆ STDMETHOD() [5/11]

QAxClientSite::STDMETHOD ( EnableModeless(BOOL fEnable)  )

◆ STDMETHOD() [6/11]

QAxClientSite::STDMETHOD ( TranslateAccelerator(LPMSG lpMsg, WORD grfModifiers)  )

◆ STDMETHOD() [7/11]

QAxClientSite::STDMETHOD ( GetBorder(LPRECT lprectBorder)  )

◆ STDMETHOD() [8/11]

QAxClientSite::STDMETHOD ( RequestBorderSpace(LPCBORDERWIDTHS pborderwidths)  )

◆ STDMETHOD() [9/11]

QAxClientSite::STDMETHOD ( SetBorderSpace(LPCBORDERWIDTHS pborderwidths)  )

◆ STDMETHOD() [10/11]

QAxClientSite::STDMETHOD ( SetActiveObject(IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)  )

◆ STDMETHOD() [11/11]

QAxClientSite::STDMETHOD ( ActivateMe(IOleDocumentView *pViewToActivate)  )

◆ STDMETHOD_() [1/5]

QAxClientSite::STDMETHOD_ ( void  ,
OnDataChange   
)

◆ STDMETHOD_() [2/5]

STGMEDIUM* QAxClientSite::STDMETHOD_ ( void  ,
OnViewChange   
)

◆ STDMETHOD_() [3/5]

QAxClientSite::STDMETHOD_ ( void  ,
OnRename   
)
inline

Definition at line 353 of file qaxwidget.cpp.

354  {
355  }

◆ STDMETHOD_() [4/5]

QAxClientSite::STDMETHOD_ ( void  ,
OnSave   
)
inline

Definition at line 356 of file qaxwidget.cpp.

357  {
358  }

◆ STDMETHOD_() [5/5]

QAxClientSite::STDMETHOD_ ( void  ,
OnClose   
)
inline

Definition at line 359 of file qaxwidget.cpp.

360  {
361  }

◆ TransformCoords()

HRESULT WINAPI QAxClientSite::TransformCoords ( POINTL *  pPtlHimetric,
POINTF *  pPtfContainer,
DWORD  dwFlags 
)

Definition at line 973 of file qaxwidget.cpp.

974 {
975  return S_OK;
976 }

◆ TranslateAccelerator()

HRESULT WINAPI QAxClientSite::TranslateAccelerator ( LPMSG  lpMsg,
DWORD  grfModifiers 
)

Definition at line 978 of file qaxwidget.cpp.

Referenced by qt_metacall().

979 {
980  if (lpMsg->message == WM_KEYDOWN && !lpMsg->wParam)
981  return S_OK;
982 
983  bool ActiveQtDetected = false;
984  bool fromInProcServer = false;
985 #ifdef GWLP_USERDATA
986  LONG_PTR serverType = GetWindowLongPtr(lpMsg->hwnd, GWLP_USERDATA);
987 #else
988  LONG serverType = GetWindowLong(lpMsg->hwnd, GWL_USERDATA);
989 #endif
990  if (serverType == QAX_INPROC_SERVER) {
991  ActiveQtDetected = true;
992  fromInProcServer = true;
993  } else if (serverType == QAX_OUTPROC_SERVER) {
994  ActiveQtDetected = true;
995  fromInProcServer = false;
996  }
997 
998  eventTranslated = false;
999  if (!ActiveQtDetected || !fromInProcServer) {
1000  // if the request is coming from an out-of-proc server or a non ActiveQt server,
1001  // we send the message to the host window. This will make sure this key event
1002  // comes to Qt for processing.
1003  SendMessage(host->winId(), lpMsg->message, lpMsg->wParam, lpMsg->lParam);
1004  if (ActiveQtDetected && !fromInProcServer) {
1005  // ActiveQt based servers will need further processing of the event
1006  // (eg. <SPACE> key for a checkbox), so we return false.
1007  return S_FALSE;
1008  }
1009  }
1010  // ActiveQt based in-processes-servers will handle the event properly, so
1011  // we don't need to send this key event to the host.
1012  return S_OK;
1013 }
STGMEDIUM LONG
Definition: qaxwidget.cpp:350
#define QAX_OUTPROC_SERVER
Definition: qaxtypes.h:94
QAxHostWidget * host
Definition: qaxwidget.cpp:413
bool eventTranslated
Definition: qaxwidget.cpp:377
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
#define QAX_INPROC_SERVER
Definition: qaxtypes.h:93

◆ translateKeyEvent()

bool QAxClientSite::translateKeyEvent ( int  message,
int  keycode 
) const
inline

Definition at line 367 of file qaxwidget.cpp.

Referenced by axc_FilterProc().

368  {
369  if (!widget)
370  return false;
371  return widget->translateKeyEvent(message, keycode);
372  }
int keycode
virtual bool translateKeyEvent(int message, int keycode) const
Reimplement this function to pass certain key events to the ActiveX control.
Definition: qaxwidget.cpp:2238
QAxWidget * widget
Definition: qaxwidget.cpp:412

◆ windowActivationChange()

void QAxClientSite::windowActivationChange ( )

Definition at line 1605 of file qaxwidget.cpp.

Referenced by QAxWidget::changeEvent().

1606 {
1608 
1611  if (modal && inPlaceModelessEnabled) {
1612  m_spInPlaceActiveObject->EnableModeless(false);
1613  inPlaceModelessEnabled = false;
1614  } else if (!inPlaceModelessEnabled) {
1615  m_spInPlaceActiveObject->EnableModeless(true);
1616  inPlaceModelessEnabled = true;
1617  }
1618  m_spInPlaceActiveObject->OnFrameWindowActivate(widget->isActiveWindow());
1619  }
1620 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define AX_DEBUG(x)
Definition: qaxwidget.cpp:73
bool isActiveWindow() const
static QWidget * activeModalWidget()
Returns the active modal widget.
QAxWidget * widget
Definition: qaxwidget.cpp:412
bool modal
Definition: qmenu_mac.mm:99
bool inPlaceModelessEnabled
Definition: qaxwidget.cpp:401
IOleInPlaceActiveObject * m_spInPlaceActiveObject
Definition: qaxwidget.cpp:395
void windowActivationChange()
Definition: qaxwidget.cpp:1605

Friends and Related Functions

◆ QAxHostWidget

friend class QAxHostWidget
friend

Definition at line 164 of file qaxwidget.cpp.

Referenced by activateObject().

Properties

◆ aggregatedObject

QAxAggregated* QAxClientSite::aggregatedObject
private

Definition at line 398 of file qaxwidget.cpp.

Referenced by QAxClientSite(), QueryInterface(), and ~QAxClientSite().

◆ canHostDocument

bool QAxClientSite::canHostDocument
private

Definition at line 402 of file qaxwidget.cpp.

Referenced by activateObject(), QAxClientSite(), and QueryInterface().

◆ control_info

CONTROLINFO QAxClientSite::control_info
private

Definition at line 408 of file qaxwidget.cpp.

Referenced by activateObject(), OnControlInfoChanged(), and QAxClientSite().

◆ eventTranslated

bool QAxClientSite::eventTranslated

Definition at line 377 of file qaxwidget.cpp.

Referenced by axc_FilterProc(), and TranslateAccelerator().

◆ host

QAxHostWidget* QAxClientSite::host
private

◆ inPlaceModelessEnabled

bool QAxClientSite::inPlaceModelessEnabled
private

◆ inPlaceObjectWindowless

bool QAxClientSite::inPlaceObjectWindowless
private

◆ LONG

STGMEDIUM QAxClientSite::LONG
Initial value:
{
AX_DEBUG(QAxClientSite::OnViewChange)

Definition at line 350 of file qaxwidget.cpp.

Referenced by Release(), and TranslateAccelerator().

◆ m_dwOleObject

DWORD QAxClientSite::m_dwOleObject
private

Definition at line 404 of file qaxwidget.cpp.

Referenced by activateObject(), QAxClientSite(), and releaseAll().

◆ m_spActiveView

IOleDocumentView* QAxClientSite::m_spActiveView
private

Definition at line 396 of file qaxwidget.cpp.

Referenced by QAxClientSite(), qt_metacall(), and QAxHostWidget::resizeObject().

◆ m_spInPlaceActiveObject

IOleInPlaceActiveObject* QAxClientSite::m_spInPlaceActiveObject
private

◆ m_spInPlaceObject

IOleInPlaceObjectWindowless* QAxClientSite::m_spInPlaceObject
private

◆ m_spOleControl

IOleControl* QAxClientSite::m_spOleControl
private

◆ m_spOleObject

IOleObject* QAxClientSite::m_spOleObject
private

◆ ref

LONG QAxClientSite::ref
private

Definition at line 411 of file qaxwidget.cpp.

Referenced by AddRef(), and Release().

◆ sizehint

QSize QAxClientSite::sizehint
private

Definition at line 410 of file qaxwidget.cpp.

Referenced by activateObject().

◆ widget

QAxWidget* QAxClientSite::widget
private

The documentation for this class was generated from the following file: