xref: /haiku/src/apps/icon-o-matic/import_export/Importer.h (revision 445d4fd926c569e7b9ae28017da86280aaecbae2)
1 /*
2  * Copyright 2006, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 #ifndef IMPORTER_H
9 #define IMPORTER_H
10 
11 
12 #include <SupportDefs.h>
13 
14 #include "IconBuild.h"
15 
16 
17 _BEGIN_ICON_NAMESPACE
18 	class Icon;
19 _END_ICON_NAMESPACE
20 
21 _USING_ICON_NAMESPACE
22 
23 /*! Base class providing facilities for all importers.
24 	Child classes should have an Import function taking parameters relavent to
25 	the thing they import.
26 
27 	\note Some importers are in the icon library.
28 */
29 class Importer {
30  public:
31 								Importer();
32 	virtual						~Importer();
33 
34 			status_t			Init(Icon* icon);
35 
36 	/*!
37 		Sometimes the thing being imported is being imported into a file that
38 		already has items. This means that style index zero and path index zero
39 		are likely already taken. These functions take in a zero-based index
40 		and offset them to a previously unused style/path index.
41 	*/
42 
43 	//! @{
44 			int32				StyleIndexFor(int32 savedIndex) const;
45 			int32				PathIndexFor(int32 savedIndex) const;
46 	//! @}
47  private:
48 			int32				fStyleIndexOffset;
49 			int32				fPathIndexOffset;
50 };
51 
52 #endif // IMPORTER_H
53