Chromium Code Reviews| Index: printing/metafile_factory.h |
| diff --git a/printing/metafile_factory.h b/printing/metafile_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5e80cc85b7cad7c74f18bac473d583734aba92bf |
| --- /dev/null |
| +++ b/printing/metafile_factory.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef METAFILE_FACTORY_H_ |
|
vandebo (ex-Chrome)
2011/02/22 22:18:16
PRINTING_NATIVE_METAFILE_FACTORY_H_
dpapad
2011/02/23 00:44:39
Done.
|
| +#define METAFILE_FACTORY_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "printing/native_metafile.h" |
| + |
| +#if defined(OS_WIN) |
| + #include "printing/emf_win.h" |
| +#elif defined(OS_MACOSX) |
| + #include "printing/pdf_metafile_mac.h" |
| +#elif defined(OS_POSIX) |
| + #include "printing/pdf_ps_metafile_cairo.h" |
| +#endif |
| + |
| +namespace printing { |
| + |
| +// This class is used to obtain pointers to NativeMetafile objects. It is the |
|
vandebo (ex-Chrome)
2011/02/22 22:18:16
This comment can be improved; most readers will un
dpapad
2011/02/23 00:44:39
Done.
|
| +// only way to initialize such objects since their constructors are private. |
| +class MetafileFactory { |
|
vandebo (ex-Chrome)
2011/02/22 22:18:16
NativeMetafileFactory
dpapad
2011/02/23 00:44:39
Done.
|
| + public: |
| + virtual ~MetafileFactory(); |
|
vandebo (ex-Chrome)
2011/02/22 22:18:16
Not necessary, as there is currently no way to cre
dpapad
2011/02/23 00:44:39
Done.
|
| + |
| + // This method takes care of returning a pointer to the appropriate |
| + // NativeMetafile object according to the platform. |
| + static printing::NativeMetafile* GetMetafile(); |
|
vandebo (ex-Chrome)
2011/02/22 22:18:16
Get implies retrieval and not creation. Since thi
dpapad
2011/02/23 00:44:39
Done.
|
| + |
| +#if defined(OS_LINUX) |
| + static printing::NativeMetafile* |
| + GetMetafileFrom(cairo_t* context); |
| +#endif |
| + |
| + private: |
| + MetafileFactory(); |
| + DISALLOW_COPY_AND_ASSIGN(MetafileFactory); |
| +}; |
| + |
| +} // namespace printing |
| + |
| +#endif /* METAFILE_FACTORY_H_ */ |