use some forward declares to reduce includes

Change-Id: Ic3a6d9a9569f909a7480d9da09709dbd60259e97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112323
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/include/sfx2/ipclient.hxx b/include/sfx2/ipclient.hxx
index 438807a..180f67b 100644
--- a/include/sfx2/ipclient.hxx
+++ b/include/sfx2/ipclient.hxx
@@ -26,11 +26,12 @@

#include <tools/gen.hxx>

#include <vcl/window.hxx>
#include <vcl/errcode.hxx>
#include <vcl/vclptr.hxx>

namespace com::sun::star::embed { class XEmbeddedObject; }
namespace com::sun::star::uno { template <typename > class Reference; }
namespace vcl { class Window; }

class SfxInPlaceClient_Impl;
class SfxViewShell;
diff --git a/include/sfx2/lokcharthelper.hxx b/include/sfx2/lokcharthelper.hxx
index 020abad..319af8c 100644
--- a/include/sfx2/lokcharthelper.hxx
+++ b/include/sfx2/lokcharthelper.hxx
@@ -12,10 +12,11 @@

#include <sfx2/dllapi.h>
#include <tools/gen.hxx>
#include <vcl/window.hxx>
#include <vcl/vclptr.hxx>

namespace com::sun::star::frame { class XController; }
namespace com::sun::star::frame { class XDispatch; }
namespace vcl { class Window; }

class SfxViewShell;
class VirtualDevice;
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index 65d4408..7150d64 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -25,11 +25,12 @@
#include <sal/types.h>
#include <svl/poolitem.hxx>
#include <svtools/toolboxcontroller.hxx>
#include <vcl/window.hxx>
#include <rtl/ref.hxx>
#include <vcl/vclptr.hxx>

namespace com::sun::star::frame { class XDispatchProvider; }
namespace com::sun::star::frame { class XFrame; }
namespace vcl { class Window; }

class InterimItemWindow;
class SfxToolBoxControl;
diff --git a/include/svx/AccessibleShapeTreeInfo.hxx b/include/svx/AccessibleShapeTreeInfo.hxx
index f9da042..f50061a 100644
--- a/include/svx/AccessibleShapeTreeInfo.hxx
+++ b/include/svx/AccessibleShapeTreeInfo.hxx
@@ -22,13 +22,14 @@

#include <com/sun/star/uno/Reference.hxx>
#include <svx/svxdllapi.h>
#include <vcl/window.hxx>
#include <vcl/vclptr.hxx>

namespace com::sun::star {
    namespace accessibility { class XAccessibleComponent; }
    namespace document { class XShapeEventBroadcaster; }
    namespace frame { class XController; }
}
namespace vcl { class Window; }

class SdrView;

diff --git a/include/svx/ImageMapInfo.hxx b/include/svx/ImageMapInfo.hxx
index 7cd8f4f..0e12df2 100644
--- a/include/svx/ImageMapInfo.hxx
+++ b/include/svx/ImageMapInfo.hxx
@@ -49,7 +49,7 @@ public:

    static SvxIMapInfo* GetIMapInfo(const SdrObject* pObject);
    static IMapObject* GetHitIMapObject(const SdrObject* pObj, const Point& rWinPoint,
                                        const vcl::Window* rCmpWnd = nullptr);
                                        const OutputDevice* pCmpWnd = nullptr);
};

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index 251b5bd..d0c56ea 100644
--- a/include/vcl/vclenum.hxx
+++ b/include/vcl/vclenum.hxx
@@ -387,6 +387,19 @@ namespace o3tl
    template<> struct typed_flags<FloatWinPopupFlags> : is_typed_flags<FloatWinPopupFlags, 0x0fff> {};
}

// Flags for Window::Show()
enum class ShowFlags
{
    NONE                       = 0x0000,
    NoFocusChange              = 0x0002,
    NoActivate                 = 0x0004,
    ForegroundTask             = 0x0008,
};
namespace o3tl
{
    template<> struct typed_flags<ShowFlags> : is_typed_flags<ShowFlags, 0x000e> {};
}

#endif // INCLUDED_VCL_VCLENUM_HXX

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/waitobj.hxx b/include/vcl/waitobj.hxx
index 682153a..cd6b0c5 100644
--- a/include/vcl/waitobj.hxx
+++ b/include/vcl/waitobj.hxx
@@ -33,13 +33,8 @@ class VCL_DLLPUBLIC WaitObject
private:
    VclPtr<vcl::Window>  mpWindow;
public:
                WaitObject( vcl::Window* pWindow )
                {
                    mpWindow = pWindow;
                    if ( mpWindow )
                        mpWindow->EnterWait();
                }
                ~WaitObject();
    WaitObject(vcl::Window* pWindow);
    ~WaitObject();
};

class VCL_DLLPUBLIC TopLevelWindowLocker
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 51d6a77..000d64f 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -155,19 +155,6 @@ namespace o3tl
    template<> struct typed_flags<PosSizeFlags> : is_typed_flags<PosSizeFlags, 0x000f> {};
}

// Flags for Show()
enum class ShowFlags
{
    NONE                       = 0x0000,
    NoFocusChange              = 0x0002,
    NoActivate                 = 0x0004,
    ForegroundTask             = 0x0008,
};
namespace o3tl
{
    template<> struct typed_flags<ShowFlags> : is_typed_flags<ShowFlags, 0x000e> {};
}

// Flags for SetZOrder()
enum class ZOrderFlags
{
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 7dc9044..e5de957 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -35,7 +35,6 @@
#include <sal/log.hxx>
#include <vcl/weld.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <svl/eitem.hxx>
#include <basic/sbstar.hxx>
#include <svl/stritem.hxx>
diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx
index b1cb6e8..6e3f3c8 100644
--- a/sfx2/source/view/userinputinterception.cxx
+++ b/sfx2/source/view/userinputinterception.cxx
@@ -33,10 +33,8 @@
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/weak.hxx>
#include <vcl/event.hxx>
#include <vcl/window.hxx>
#include <osl/diagnose.h>


namespace sfx2
{

diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index facdd8d..ac2bf34 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -43,7 +43,6 @@
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
#include <tools/urlobj.hxx>
#include <vcl/window.hxx>

using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
diff --git a/svtools/source/misc/langhelp.cxx b/svtools/source/misc/langhelp.cxx
index acaf2c6..92171ea 100644
--- a/svtools/source/misc/langhelp.cxx
+++ b/svtools/source/misc/langhelp.cxx
@@ -23,7 +23,6 @@
#include <vcl/idle.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/window.hxx>
#include <config_langs.h>
#include <config_vendor.h>

diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx
index 6675e67..a62af9f 100644
--- a/svtools/source/table/mousefunction.cxx
+++ b/svtools/source/table/mousefunction.cxx
@@ -23,10 +23,8 @@
#include <table/tablesort.hxx>

#include <tools/diagnose_ex.h>
#include <vcl/window.hxx>
#include <vcl/ptrstyle.hxx>


namespace svt::table
{

diff --git a/svx/source/sdr/misc/ImageMapInfo.cxx b/svx/source/sdr/misc/ImageMapInfo.cxx
index 8612357..c50fb2f 100644
--- a/svx/source/sdr/misc/ImageMapInfo.cxx
+++ b/svx/source/sdr/misc/ImageMapInfo.cxx
@@ -24,7 +24,7 @@
#include <svx/svdoole2.hxx>
#include <vcl/imapobj.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/outdev.hxx>

SvxIMapInfo* SvxIMapInfo::GetIMapInfo(SdrObject const* pObject)
{
@@ -47,7 +47,7 @@ SvxIMapInfo* SvxIMapInfo::GetIMapInfo(SdrObject const* pObject)
}

IMapObject* SvxIMapInfo::GetHitIMapObject(const SdrObject* pObj, const Point& rWinPoint,
                                          const vcl::Window* rCmpWnd)
                                          const OutputDevice* pCmpWnd)
{
    SvxIMapInfo* pIMapInfo = GetIMapInfo(pObj);
    IMapObject* pIMapObj = nullptr;
@@ -60,11 +60,11 @@ IMapObject* SvxIMapInfo::GetHitIMapObject(const SdrObject* pObj, const Point& rW
        ImageMap& rImageMap = const_cast<ImageMap&>(pIMapInfo->GetImageMap());
        tools::Rectangle& rRect = const_cast<tools::Rectangle&>(pObj->GetLogicRect());

        if (rCmpWnd)
        if (pCmpWnd)
        {
            MapMode aWndMode = rCmpWnd->GetMapMode();
            aRelPoint = rCmpWnd->LogicToLogic(rWinPoint, &aWndMode, &aMap100);
            rRect = rCmpWnd->LogicToLogic(pObj->GetLogicRect(), &aWndMode, &aMap100);
            MapMode aWndMode = pCmpWnd->GetMapMode();
            aRelPoint = pCmpWnd->LogicToLogic(rWinPoint, &aWndMode, &aMap100);
            rRect = pCmpWnd->LogicToLogic(pObj->GetLogicRect(), &aWndMode, &aMap100);
        }

        bool bObjSupported = false;
diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx
index 39f520f..3ea43a4 100644
--- a/svx/source/table/accessiblecell.cxx
+++ b/svx/source/table/accessiblecell.cxx
@@ -31,6 +31,7 @@

#include <editeng/unoedsrc.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>

#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/string.hxx>
diff --git a/sw/source/core/access/accdoc.hxx b/sw/source/core/access/accdoc.hxx
index 452a62a..15d65eb 100644
--- a/sw/source/core/access/accdoc.hxx
+++ b/sw/source/core/access/accdoc.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
#include "accselectionhelper.hxx"
#include <vcl/window.hxx>

// base class for SwAccessibleDocument (in this same header file) and
// SwAccessiblePreview
diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx
index 2410f4b..a4ebb21 100644
--- a/vcl/source/window/window3.cxx
+++ b/vcl/source/window/window3.cxx
@@ -22,6 +22,13 @@
#include <window.h>
#include <vcl/cursor.hxx>

WaitObject::WaitObject(vcl::Window* pWindow)
    : mpWindow(pWindow)
{
    if (mpWindow)
        mpWindow->EnterWait();
}

WaitObject::~WaitObject()
{
    if (mpWindow)