[M108 Migration][HBBTV] Implement ewk_context_register_jsplugin_mime_types API
[platform/framework/web/chromium-efl.git] / courgette / adjustment_method.h
1 // Copyright 2009 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COURGETTE_ADJUSTMENT_METHOD_H_
6 #define COURGETTE_ADJUSTMENT_METHOD_H_
7
8 namespace courgette {
9
10 class AssemblyProgram;
11
12 class AdjustmentMethod {
13  public:
14   // Factory methods for making adjusters.
15
16   // Returns the adjustment method used in production.
17   static AdjustmentMethod* MakeProductionAdjustmentMethod() {
18     return MakeShingleAdjustmentMethod();
19   }
20
21   // Returns and adjustement method that makes no adjustments.
22   static AdjustmentMethod* MakeNullAdjustmentMethod();
23
24   // Returns the original adjustment method.
25   static AdjustmentMethod* MakeTrieAdjustmentMethod();
26
27   // Returns the new shingle tiling adjustment method.
28   static AdjustmentMethod* MakeShingleAdjustmentMethod();
29
30   AdjustmentMethod(const AdjustmentMethod&) = delete;
31   AdjustmentMethod& operator=(const AdjustmentMethod&) = delete;
32
33   // AdjustmentMethod interface:
34
35   // Adjusts |program| to increase similarity to |model|.  |program| can be
36   // changed in any way provided that it still produces the same output when
37   // assembled.
38   virtual bool Adjust(const AssemblyProgram& model,
39                       AssemblyProgram* program) = 0;
40
41   // Deletes 'this' adjustment method.
42   virtual void Destroy();
43
44  protected:
45   AdjustmentMethod() {}
46   virtual ~AdjustmentMethod() {}
47 };
48
49 }  // namespace courgette
50 #endif  // COURGETTE_ADJUSTMENT_METHOD_H_