summaryrefslogtreecommitdiff
path: root/sc/source/ui/collab/sccollaboration.cxx
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-07-30 11:49:10 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-08-02 18:00:55 +0200
commitbc21b49a464ae153341ee8d836993ca89b1a6919 (patch)
tree1187539ac5a405c02ef858cfba6624d5e8023a16 /sc/source/ui/collab/sccollaboration.cxx
parent4311938f7e838c6263b0e5774e611ec213cb02c6 (diff)
tubes: move sc/source/ui/collab/contacts.* to tubes
- sc no longer directly links against telepathy - there is new class ScCollaboration derived from abstract Collaboration describing collaboration functionality for apps used in tubes/ - also added resource manager into tubes/ Change-Id: Ic89ae955f5b47490f4f4b8781bcee5dea5336bae
Diffstat (limited to 'sc/source/ui/collab/sccollaboration.cxx')
-rw-r--r--sc/source/ui/collab/sccollaboration.cxx62
1 files changed, 62 insertions, 0 deletions
diff --git a/sc/source/ui/collab/sccollaboration.cxx b/sc/source/ui/collab/sccollaboration.cxx
new file mode 100644
index 000000000000..758db8918f4e
--- /dev/null
+++ b/sc/source/ui/collab/sccollaboration.cxx
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "sccollaboration.hxx"
+
+#include "docsh.hxx"
+#include "sendfunc.hxx"
+
+ScCollaboration::ScCollaboration()
+{
+}
+
+ScCollaboration::~ScCollaboration()
+{
+}
+
+TeleConference* ScCollaboration::GetConference() const
+{
+ ScDocFuncSend* pSender = GetScDocFuncSend();
+ if (pSender)
+ return pSender->GetConference();
+
+ return NULL;
+}
+
+void ScCollaboration::SetCollaboration( TeleConference* pConference )
+{
+ ScDocShell* pScDocShell = dynamic_cast<ScDocShell*> (SfxObjectShell::Current());
+ ScDocFunc* pDocFunc = pScDocShell ? &pScDocShell->GetDocFunc() : NULL;
+ ScDocFuncSend* pSender = dynamic_cast<ScDocFuncSend*> (pDocFunc);
+ if (!pSender)
+ {
+ // This means pDocFunc has to be ScDocFuncDirect* and we are not collaborating yet.
+ ScDocFuncDirect *pDirect = dynamic_cast<ScDocFuncDirect*> (pDocFunc);
+ ScDocFuncRecv *pReceiver = new ScDocFuncRecv( pDirect );
+ pSender = new ScDocFuncSend( *pScDocShell, pReceiver );
+ pScDocShell->SetDocFunc( pSender );
+ }
+ pSender->SetCollaboration( pConference );
+}
+
+void ScCollaboration::SendFile( TpContact* pContact, const OUString& rURL )
+{
+ ScDocFuncSend* pSender = GetScDocFuncSend();
+ if (pSender)
+ pSender->SendFile( pContact, rURL );
+}
+
+ScDocFuncSend* ScCollaboration::GetScDocFuncSend() const
+{
+ ScDocShell *pScDocShell = dynamic_cast<ScDocShell*> (SfxObjectShell::Current());
+ ScDocFunc *pDocFunc = pScDocShell ? &pScDocShell->GetDocFunc() : NULL;
+ return dynamic_cast<ScDocFuncSend*> (pDocFunc);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */