atom_api_box_layout.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (c) 2018 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_BROWSER_API_ATOM_API_BOX_LAYOUT_H_
  5. #define ATOM_BROWSER_API_ATOM_API_BOX_LAYOUT_H_
  6. #include "atom/browser/api/atom_api_layout_manager.h"
  7. #include "native_mate/handle.h"
  8. #include "ui/views/layout/box_layout.h"
  9. namespace atom {
  10. namespace api {
  11. class View;
  12. class BoxLayout : public LayoutManager {
  13. public:
  14. static mate::WrappableBase* New(mate::Arguments* args,
  15. views::BoxLayout::Orientation orientation);
  16. static void BuildPrototype(v8::Isolate* isolate,
  17. v8::Local<v8::FunctionTemplate> prototype);
  18. void SetFlexForView(mate::Handle<View> view, int flex);
  19. protected:
  20. explicit BoxLayout(views::BoxLayout::Orientation orientation);
  21. ~BoxLayout() override;
  22. private:
  23. DISALLOW_COPY_AND_ASSIGN(BoxLayout);
  24. };
  25. } // namespace api
  26. } // namespace atom
  27. #endif // ATOM_BROWSER_API_ATOM_API_BOX_LAYOUT_H_