summaryrefslogtreecommitdiff
path: root/vcl/inc/salvtables.hxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2023-07-06 15:36:39 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2023-07-11 15:51:11 +0200
commit16d600edcc33b72a9d09b7f2f496313612ffebd4 (patch)
tree75648c4dc24cac0ba0e15dcf95de3d97c19e30a0 /vcl/inc/salvtables.hxx
parent0ee798d3a4cc90629e96f0f6c780c2887ae521d0 (diff)
jsdialog: Move SalInstanceCalendar decl to header file
Change-Id: Ide9e685d724d646f0ab8825b1fce2b6fd130d3ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154135 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit d792875d79a63364dba02426ef75d696ae0f02ef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154266 Tested-by: Jenkins
Diffstat (limited to 'vcl/inc/salvtables.hxx')
-rw-r--r--vcl/inc/salvtables.hxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 7ac28808ce3d..d3949cd68590 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -27,6 +27,7 @@
#include <vcl/toolkit/svtabbx.hxx>
#include <vcl/toolkit/svlbitm.hxx>
#include <o3tl/sorted_vector.hxx>
+#include "calendar.hxx"
#include "iconview.hxx"
#include "listbox.hxx"
#include "messagedialog.hxx"
@@ -2178,4 +2179,32 @@ public:
virtual ~SalInstanceScrolledWindow() override;
};
+class SalInstanceCalendar : public SalInstanceWidget, public virtual weld::Calendar
+{
+private:
+ VclPtr<::Calendar> m_xCalendar;
+
+ DECL_LINK(SelectHdl, ::Calendar*, void);
+ DECL_LINK(ActivateHdl, ::Calendar*, void);
+
+public:
+ SalInstanceCalendar(::Calendar* pCalendar, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+ : SalInstanceWidget(pCalendar, pBuilder, bTakeOwnership)
+ , m_xCalendar(pCalendar)
+ {
+ m_xCalendar->SetSelectHdl(LINK(this, SalInstanceCalendar, SelectHdl));
+ m_xCalendar->SetActivateHdl(LINK(this, SalInstanceCalendar, ActivateHdl));
+ }
+
+ virtual void set_date(const Date& rDate) override { m_xCalendar->SetCurDate(rDate); }
+
+ virtual Date get_date() const override { return m_xCalendar->GetFirstSelectedDate(); }
+
+ virtual ~SalInstanceCalendar() override
+ {
+ m_xCalendar->SetSelectHdl(Link<::Calendar*, void>());
+ m_xCalendar->SetActivateHdl(Link<::Calendar*, void>());
+ }
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */