OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
ocdoc.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectComponents
3// Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
4/// \file
5/// Definition of TOcDocument Class
6//----------------------------------------------------------------------------
7
8#if !defined(OCF_OCDOC_H)
9#define OCF_OCDOC_H
10
11#include <owl/private/defs.h>
12#if defined(BI_HAS_PRAGMA_ONCE)
13# pragma once
14#endif
15
16#include <ocf/oclink.h>
17
18#include <ocf/ocpart.h>
19
20
21
22//
23// Interfaces & Classes referenced
24//
25interface _ICLASS IStorage;
26
27namespace ocf {
28
29//
30// Interfaces & Classes referenced
31//
33class _ICLASS TOcApp;
37
38//
39/// \class TOcDocument
40// ~~~~~ ~~~~~~~~~~~
41/// OC Document class, holds parts & is a owner of views
42//
44 public:
45 TOcDocument(TOcApp& app, LPCTSTR fileName = 0);
46 TOcDocument(TOcApp& app, LPCTSTR fileName, IStorage * storageI);
48
49 /// \name Collection management
50 /// @{
51 TOcPartCollection& GetParts() {return PartCollection;}
52 TOcLinkCollection& GetLinks() {return LinkCollection;}
53 TOcLinkCollection& GetViews() {return LinkCollection;} // Compatibility
54 /// @}
55
56 /// \name Storage & streaming related
57 /// @{
58 TOcStorage* GetStorage() {return Storage;}
59 void SetStorage(IStorage* storage, bool remember = true);
60 void SetStorage(LPCTSTR path);
61 bool SaveToFile(LPCTSTR newName);
62 bool RestoreStorage();
63 /// @}
64
65 /// \name Load/Save part information
66 /// @{
67 bool LoadParts();
68 bool SaveParts(IStorage* storage = 0, bool sameAsLoaded = true,
69 bool remember = true);
70 void RenameParts(IBRootLinkable * bLDocumentI);
71 void Close();
72 /// @}
73
74 /// \name Get/Set active view
75 /// @{
76 TOcView* GetActiveView() {return ActiveView;}
77 void SetActiveView(TOcView* view);
78 /// @}
79
80 /// \name Get/Set document name
81 /// @{
82 owl::tstring GetName() const {return Name;}
83 void SetName(const owl::tstring& newName);
84 /// @}
85
86 int AllocPartID() {return ++PartID;}
87 TOcApp& GetOcApp() {return OcApp;}
88
89 private:
90 TOcView* ActiveView; ///< Active TOcView object
91 TOcApp& OcApp; ///< Our OC application object
92 TOcStorage* Storage; ///< root storage for embedded objects
93 TOcStorage* OrgStorage; ///< original root storage for embedded objects
94
95 int PartID;
97 TOcPartCollection PartCollection;
98 TOcLinkCollection LinkCollection;
99
100 //friend class TOcPartCollectionIter; // To allow iterator access to collection
101 //friend class TOcLinkCollectionIter; // To allow iterator access to collection
102 friend class _ICLASS TOcControl;
103 friend class _ICLASS TOcView;
104 friend class _ICLASS TOcRemVie;
105};
106
107} // OCF namespace
108
109#endif // OCF_OCDOC_H
110
OCF Application class.
Definition ocapp.h:144
Class representing an embedded control within a document.
Definition occtrl.h:78
OC Document class, holds parts & is a owner of views.
Definition ocdoc.h:43
TOcLinkCollection & GetViews()
Definition ocdoc.h:53
TOcApp & GetOcApp()
Definition ocdoc.h:87
TOcLinkCollection & GetLinks()
Definition ocdoc.h:52
int AllocPartID()
Definition ocdoc.h:86
TOcStorage * GetStorage()
Definition ocdoc.h:58
owl::tstring GetName() const
Definition ocdoc.h:82
TOcPartCollection & GetParts()
Definition ocdoc.h:51
TOcView * GetActiveView()
Definition ocdoc.h:76
Container of parts with iterator.
Definition ocpart.h:172
The TOcView partner is a container (viewer) of a given (server/client) document.
Definition ocview.h:136
Object Component Framework (COM encapsulation)
Definition appdesc.h:22
class _ICLASS TOcRemVie
Definition ocdoc.h:36
std::string tstring
Definition defs.h:79
interface _ICLASS IStorage
Definition ocdoc.h:25
Definition of TOcPart class.
#define _ICLASS
Definition oleutil.h:25