Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <precomp.h>
21 : #include "adc_cmds.hxx"
22 :
23 :
24 : // NOT FULLY DEFINED SERVICES
25 : #include <ary/ary.hxx>
26 : #include <autodoc/displaying.hxx>
27 : #include <autodoc/dsp_html_std.hxx>
28 : #include <display/corframe.hxx>
29 : #include <adc_cl.hxx>
30 :
31 :
32 : namespace autodoc
33 : {
34 : namespace command
35 : {
36 :
37 1 : extern const String C_opt_Include("-I:");
38 :
39 1 : extern const String C_opt_Verbose("-v");
40 :
41 1 : extern const String C_opt_Parse("-parse");
42 1 : extern const String C_opt_Name("-name");
43 1 : extern const String C_opt_LangAll("-lg");
44 1 : extern const String C_opt_ExtensionsAll("-extg");
45 1 : extern const String C_opt_DevmanFile("-dvgfile");
46 1 : extern const String C_opt_SinceFile("-sincefile");
47 :
48 1 : extern const String C_arg_Idl("idl");
49 :
50 1 : extern const String C_opt_Project("-p");
51 : //extern const String C_opt_Lang;
52 : //extern const String C_opt_Extensions;
53 1 : extern const String C_opt_SourceDir("-d");
54 1 : extern const String C_opt_SourceTree("-t");
55 1 : extern const String C_opt_SourceFile("-f");
56 :
57 1 : extern const String C_opt_CreateHtml("-html");
58 1 : extern const String C_opt_DevmanRoot("-dvgroot");
59 :
60 : //extern const String C_opt_CreateXml("-xml");
61 : //extern const String C_opt_Load("-load");
62 : //extern const String C_opt_Save("-save");
63 :
64 1 : extern const String C_opt_ExternNamespace("-extnsp");
65 1 : extern const String C_opt_ExternRoot("-extroot");
66 :
67 :
68 :
69 : //************************** CreateHTML ***********************//
70 :
71 1 : CreateHtml::CreateHtml()
72 : : sOutputRootDirectory(),
73 1 : sDevelopersManual_HtmlRoot()
74 : {
75 1 : }
76 :
77 2 : CreateHtml::~CreateHtml()
78 : {
79 2 : }
80 :
81 : void
82 1 : CreateHtml::do_Init( opt_iter & it,
83 : opt_iter itEnd )
84 : {
85 1 : ++it;
86 2 : CHECKOPT( it != itEnd && (*it).char_at(0) != '-',
87 2 : "output directory", C_opt_CreateHtml );
88 1 : sOutputRootDirectory = *it;
89 :
90 6 : for ( ++it;
91 4 : it != itEnd AND (*it == C_opt_DevmanRoot);
92 : ++it )
93 : {
94 1 : if (*it == C_opt_DevmanRoot)
95 : {
96 1 : ++it;
97 2 : CHECKOPT( it != itEnd AND (*it).char_at(0) != '-',
98 : "HTML root directory of Developers Guide",
99 2 : C_opt_DevmanRoot );
100 1 : sDevelopersManual_HtmlRoot = *it;
101 : }
102 : } // end for
103 1 : }
104 :
105 : bool
106 1 : CreateHtml::do_Run() const
107 : {
108 1 : if ( CommandLine::Get_().IdlUsed() )
109 1 : run_Idl();
110 1 : return true;
111 : }
112 :
113 : int
114 1 : CreateHtml::inq_RunningRank() const
115 : {
116 1 : return static_cast<int>(rank_CreateHtml);
117 : }
118 :
119 : void
120 1 : CreateHtml::run_Idl() const
121 : {
122 : const ary::idl::Gate &
123 1 : rGate = CommandLine::Get_().TheRepository().Gate_Idl();
124 :
125 1 : Cout() << "Creating HTML-output into the directory "
126 2 : << sOutputRootDirectory
127 1 : << "."
128 2 : << Endl();
129 :
130 : const DisplayToolsFactory_Ifc &
131 1 : rToolsFactory = DisplayToolsFactory_Ifc::GetIt_();
132 : Dyn<autodoc::HtmlDisplay_Idl_Ifc>
133 1 : pDisplay( rToolsFactory.Create_HtmlDisplay_Idl() );
134 :
135 : DYN display::CorporateFrame & // KORR_FUTURE: Remove the need for const_cast
136 1 : drFrame = const_cast< display::CorporateFrame& >(rToolsFactory.Create_StdFrame());
137 1 : if (NOT DevelopersManual_HtmlRoot().empty())
138 1 : drFrame.Set_DevelopersGuideHtmlRoot( DevelopersManual_HtmlRoot() );
139 :
140 : pDisplay->Run( sOutputRootDirectory,
141 : rGate,
142 1 : drFrame );
143 1 : }
144 :
145 : } // namespace command
146 3 : } // namespace autodoc
147 :
148 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|