-
Notifications
You must be signed in to change notification settings - Fork 1
/
DOCMain.cpp
45 lines (39 loc) · 948 Bytes
/
DOCMain.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// DOCMain.cpp
// Copyright (c) 2014 Markus Himmel <[email protected]>
// This file is distributed under the terms of the MIT license.
#include <Alert.h>
#include <Application.h>
#include <Catalog.h>
#include <File.h>
#include "DOCTranslator.h"
#include "DOCView.h"
#include "TranslatorWindow.h"
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "DOCTranslator"
int
main()
{
BApplication app("application/x-vnd.Haiku-DOCTranslator");
DOCTranslator *dt = new DOCTranslator();
/*
status_t result;
result = LaunchTranslatorWindow(new DOCTranslator,
B_TRANSLATE("DOC Settings"), BRect(0, 0, DOC_VIEW_WIDTH,
DOC_VIEW_HEIGHT));
(new BAlert("Main", "Main 2", "OK"))->Go();
if (result == B_OK)
{
app.Run();
return 0;
}
else
{
return 1;
}
*/
BFile source("in.doc", O_RDONLY);
BFile destination("out.txt", O_WRONLY);
dt->Translate(&source, NULL, NULL, B_PDF_FORMAT, &destination);
dt->Release();
return 0;
}